import * as React from 'react';
|
import {
|
Avatar,
|
Box,
|
Button,
|
List,
|
Grid,
|
ListItem,
|
Typography,
|
ListItemAvatar,
|
ListItemButton,
|
ListItemText,
|
} from '@mui/material';
|
import CommentIcon from '@mui/icons-material/Comment';
|
import CardWithIcon from '../components/CardWithIcon';
|
import { Link } from 'react-router-dom';
|
import {
|
ReferenceField,
|
FunctionField,
|
useGetList,
|
useTranslate,
|
useIsDataLoaded,
|
} from 'react-admin';
|
|
const NbCard = (props) => {
|
const { tasks, total, ...rset } = props;
|
const translate = useTranslate();
|
|
const display = 'display';
|
|
return (
|
<>
|
<CardWithIcon
|
icon={CommentIcon}
|
title={translate('page.dashboard.pending_reviews')}
|
subtitle={total}
|
{...rset}
|
>
|
<List sx={{ display }}>
|
{tasks?.map((record) => (
|
<ListItem key={record.id} disablePadding>
|
<ListItemButton
|
alignItems="flex-start"
|
component={Link}
|
to={`/task/${record.id}`}
|
>
|
<Grid container item md={12}>
|
<Box sx={{ display: 'flex' }}>
|
<Box sx={{ display: 'flex', padding: '1em' }}>
|
<Typography color="textSecondary">{translate("table.field.task.taskCode")}:</Typography>
|
<Typography color="textSecondary">{record?.taskCode}</Typography>
|
</Box>
|
</Box>
|
<Box sx={{ display: 'flex' }}>
|
<Box sx={{ display: 'flex', padding: '1em' }}>
|
<Typography color="textSecondary">{translate("table.field.task.taskType")}:</Typography>
|
<Typography color="textSecondary" maxWidth="200" overflow="hidden">{record?.taskType$}</Typography>
|
</Box>
|
</Box>
|
<Box sx={{ display: 'flex' }}>
|
<Box sx={{ display: 'flex', padding: '1em' }}>
|
<Typography color="textSecondary">{translate("table.field.task.taskStatus")}:</Typography>
|
<Typography color="textSecondary">{record?.taskStatus$}</Typography>
|
</Box>
|
</Box>
|
<Box sx={{ display: 'flex' }}>
|
<Box sx={{ display: 'flex', padding: '1em' }}>
|
<Typography color="textSecondary">{translate("table.field.task.startTime")}:</Typography>
|
<Typography color="textSecondary">{record?.createTime}</Typography>
|
</Box>
|
</Box>
|
</Grid>
|
</ListItemButton>
|
<Spacer />
|
</ListItem>
|
))}
|
</List>
|
<Box flexGrow={1}> </Box>
|
{/* <Button
|
sx={{ borderRadius: 0 }}
|
component={Link}
|
to="/task"
|
size="small"
|
color="primary"
|
>
|
<Box p={1} sx={{ color: 'primary.main' }}>
|
{translate('pos.dashboard.all_reviews')}
|
</Box>
|
</Button> */}
|
</CardWithIcon>
|
</>
|
);
|
};
|
|
const Spacer = () => <span style={{ width: '1em', }} />;
|
|
|
export default NbCard;
|