import { List, BooleanField, TextField, Datagrid, SavedQueriesList, FilterLiveSearch, FilterList, FilterListItem, } from 'react-admin'; import { Card, CardContent } from '@mui/material'; import MailIcon from '@mui/icons-material/MailOutline'; import CategoryIcon from '@mui/icons-material/LocalOffer'; export const PostFilterSidebar = () => ( <Card sx={{ order: -1, mr: 2, mt: 9, width: 200 }}> <CardContent> <SavedQueriesList /> <FilterLiveSearch /> <FilterList label="Subscribed to newsletter" icon={<MailIcon />}> <FilterListItem label="Yes" value={{ has_newsletter: true }} /> <FilterListItem label="No" value={{ has_newsletter: false }} /> </FilterList> <FilterList label="Category" icon={<CategoryIcon />}> <FilterListItem label="Tests" value={{ category: 'tests' }} /> <FilterListItem label="News" value={{ category: 'news' }} /> <FilterListItem label="Deals" value={{ category: 'deals' }} /> <FilterListItem label="Tutorials" value={{ category: 'tutorials' }} /> </FilterList> </CardContent> </Card> ); export const RAasideFilterList = () => { return (<List resource="t_geyao_person" aside={<PostFilterSidebar />}> <Datagrid> <TextField source='id'></TextField> <TextField source='name'></TextField> <TextField source='sex'></TextField> <TextField source='salary'></TextField> <BooleanField source='status'></BooleanField> </Datagrid> </List>) }