import { useQuery } from 'react-query' import { getAllUsers } from '../utils/requests' import Loading from './Loading' import Error from './Error' import { Link } from 'react-router-dom' import { Typography, Box, Card, Table, TableHead, TableRow, TableCell, TableBody, } from '@mui/material' const Users = () => { const result = useQuery('users', getAllUsers) const users = result.data const UserTable = () => { return ( Users Name Blogs Created {users.map(user => ( {user.name} {user.blogs.length} ))}
) } return (
{result.isLoading ? ( ) : result.isError ? ( ) : ( )}
) } export default Users