|  |  | 
 |  |  | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; | 
 |  |  | import { useNavigate } from 'react-router-dom'; | 
 |  |  | import { | 
 |  |  |     ListBase, | 
 |  |  |     DatagridConfigurable, | 
 |  |  |     SearchInput, | 
 |  |  |     TopToolbar, | 
 |  |  |     SelectColumnsButton, | 
 |  |  |     EditButton, | 
 |  |  |     FilterButton, | 
 |  |  |     CreateButton, | 
 |  |  |     ExportButton, | 
 |  |  |     BulkDeleteButton, | 
 |  |  |     WrapperField, | 
 |  |  |     useRecordContext, | 
 |  |  |     useTranslate, | 
 |  |  |     useListContext, | 
 |  |  |     useCreatePath, | 
 |  |  |     TextField, | 
 |  |  |     NumberField, | 
 |  |  |     DateField, | 
 |  |  |     BooleanField, | 
 |  |  |     ReferenceField, | 
 |  |  |     TextInput, | 
 |  |  |     DateTimeInput, | 
 |  |  |     DateInput, | 
 |  |  |     SelectInput, | 
 |  |  |     NumberInput, | 
 |  |  |     ReferenceInput, | 
 |  |  |     ReferenceArrayInput, | 
 |  |  |     AutocompleteInput, | 
 |  |  |     ListToolbar, | 
 |  |  |     Title, | 
 |  |  | } from 'react-admin'; | 
 |  |  | import { matchPath, useLocation } from 'react-router'; | 
 |  |  | import { Box, Typography, Card, Stack } from '@mui/material'; | 
 |  |  | import { styled } from '@mui/material/styles'; | 
 |  |  | import EmptyData from "../components/EmptyData"; | 
 |  |  | import PageDrawer from "../components/PageDrawer"; | 
 |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; | 
 |  |  | import * as Common from '@/utils/common'; | 
 |  |  | // import { MissionEmpty } from "./MissionEmpty"; | 
 |  |  | import MissionShow from "./MissionShow"; | 
 |  |  | import { MissionListContent } from "./MissionListContent"; | 
 |  |  |  | 
 |  |  | const MissionList = () => { | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <> | 
 |  |  |             <h1>Fuck</h1> | 
 |  |  |             <ListBase | 
 |  |  |                 perPage={100} | 
 |  |  |                 filter={{ | 
 |  |  |                 }} | 
 |  |  |             > | 
 |  |  |                 <MissionLayout /> | 
 |  |  |             </ListBase> | 
 |  |  |         </> | 
 |  |  |     ) | 
 |  |  | } | 
 |  |  |  | 
 |  |  | const filters = [ | 
 |  |  |     <SearchInput source="q" alwaysOn />, | 
 |  |  | ]; | 
 |  |  |  | 
 |  |  | const MissionLayout = () => { | 
 |  |  |     const location = useLocation(); | 
 |  |  |     const matchShow = matchPath('/mission/:id/show', location.pathname); | 
 |  |  |     console.log(matchShow); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     const { data, isPending, filterValues } = useListContext(); | 
 |  |  |     if (isPending) return null; | 
 |  |  |     console.log(data); | 
 |  |  |  | 
 |  |  |     if (!data?.length) { | 
 |  |  |         return ( | 
 |  |  |             <> | 
 |  |  |                 {/* <MissionEmpty> */} | 
 |  |  |                 <MissionShow open={!!matchShow} id={matchShow?.params.id} /> | 
 |  |  |                 {/* <DealArchivedList /> */} | 
 |  |  |                 {/* </MissionEmpty> */} | 
 |  |  |             </> | 
 |  |  |         ); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <Stack component="div" sx={{ width: '100%' }}> | 
 |  |  |             <Title title={'menu.mission'} /> | 
 |  |  |             <ListToolbar filters={filters} actions={( | 
 |  |  |                 <TopToolbar> | 
 |  |  |                     <FilterButton /> | 
 |  |  |                     <SelectColumnsButton preferenceKey='locSts' /> | 
 |  |  |                 </TopToolbar> | 
 |  |  |             )} /> | 
 |  |  |             <Card> | 
 |  |  |                 <MissionListContent /> | 
 |  |  |             </Card> | 
 |  |  |             {/* <DealArchivedList /> */} | 
 |  |  |  | 
 |  |  |             <MissionShow open={!!matchShow} id={matchShow?.params.id} /> | 
 |  |  |         </Stack> | 
 |  |  |     ); | 
 |  |  | } | 
 |  |  |  | 
 |  |  | export default MissionList; |