-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathApp.tsx
55 lines (51 loc) · 1.45 KB
/
App.tsx
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { Admin, Resource, RefreshIconButton } from "react-admin";
import { ContainerLayout } from "@react-admin/ra-navigation";
import { ReactQueryDevtools } from "react-query/devtools";
import { Search } from "@react-admin/ra-search";
import { Box } from "@mui/material";
import KitchenIcon from "@mui/icons-material/Kitchen";
import tickets from "./tickets";
import customers from "./customers";
import products from "./products";
import { dataProvider } from "./dataProvider";
import { authProvider } from "./authProvider";
import { ConnectionWatcher } from "./ConnectionWatcher";
const MyLayout = (props: any) => (
<>
<ContainerLayout
{...props}
maxWidth="xl"
toolbar={
<Box display="flex" gap={1} mr={1}>
<Search />
<RefreshIconButton />
</Box>
}
/>
<ReactQueryDevtools initialIsOpen={false} />
<ConnectionWatcher />
</>
);
const App = () => (
<Admin
dataProvider={dataProvider}
authProvider={authProvider}
title={
<Box display="flex" gap={1} alignItems="center">
<KitchenIcon /> Acme Refrigerator HelpDesk
</Box>
}
layout={MyLayout}
>
<Resource name="tickets" {...tickets} />
<Resource name="customers" {...customers} />
<Resource name="products" {...products} />
<Resource
name="agents"
recordRepresentation={(record) =>
`${record.firstName} ${record.lastName}`
}
/>
</Admin>
);
export default App;