import Paper from '@mui/material/Paper'; import Typography from '@mui/material/Typography'; import { useGetGuestsQuery } from '../apiSlice' function Admin() { const { data: guests, isLoading, isSuccess, isError, error } = useGetGuestsQuery() let content if (isLoading) { content = Loading... } else if (isSuccess) { content = JSON.stringify(guests) } else if (isError) { content = <>{error.toString()} } return ( Admin {content} ) } export default Admin;