blob: a3da3fa6dc156c18bff51a4dcc0d052bde69a9c0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import { useGetGuestsQuery } from '../apiSlice';
function Admin() {
const {
data: guests,
isLoading,
isSuccess,
isError,
error,
} = useGetGuestsQuery();
let content;
if (isLoading) {
content = <p>Loading...</p>;
} else if (isSuccess) {
content = JSON.stringify(guests);
} else if (isError) {
content = <>{error.toString()}</>;
}
return (
<>
<p>Admin</p>
{content}
</>
);
}
export default Admin;
|