| | |
| | | ListBase, |
| | | Title, |
| | | Pagination, |
| | | ListToolbar, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | |
| | | |
| | | export const AgvGrid = () => { |
| | | const { identity } = useGetIdentity(); |
| | | if (!identity) return null; |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | if (!identity) return null; |
| | | |
| | | return ( |
| | | <> |
| | |
| | | ) |
| | | } |
| | | |
| | | const AgvGridLayout = (props) => { |
| | | const AgvGridLayout = ({ setCreateDialog }) => { |
| | | const { data, isPending, filterValues } = useListContext(); |
| | | const hasFilters = filterValues && Object.keys(filterValues).length > 0; |
| | | |
| | | if (isPending) return null; |
| | | if (!data?.length && !hasFilters) return <EmptyData onClick={() => { props.setCreateDialog(true) }} />; |
| | | if (!data?.length && !hasFilters) return <EmptyData onClick={() => { setCreateDialog(true) }} />; |
| | | |
| | | return ( |
| | | <Stack direction="row" component="div"> |
| | | <Stack sx={{ width: '100%' }}> |
| | | <Title title={'Companies'} /> |
| | | <Title title={"menu.agv"} /> |
| | | <ListToolbar actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} variant="contained" /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} /> |
| | |
| | | </Stack> |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |