|  |  | 
 |  |  | import { format } from 'date-fns'; | 
 |  |  | import { TaskList } from "./TaskList"; | 
 |  |  | import { ActionsIterator } from "../action/ActionsIterator"; | 
 |  |  | import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos'; | 
 |  |  |  | 
 |  |  |  | 
 |  |  | const MissionShow = ({ open, id }) => { | 
 |  |  |     const redirect = useRedirect(); | 
 |  |  | 
 |  |  |     const record = useRecordContext(); | 
 |  |  |     const translate = useTranslate(); | 
 |  |  |     if (!record) return null; | 
 |  |  |     console.log(record); | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <> | 
 |  |  | 
 |  |  |                                     color="textSecondary" | 
 |  |  |                                     variant="caption" | 
 |  |  |                                 > | 
 |  |  |                                     Last sending date | 
 |  |  |                                     {translate('table.field.mission.lastSendDate')} | 
 |  |  |                                 </Typography> | 
 |  |  |                                 <Stack | 
 |  |  |                                     direction="row" | 
 |  |  | 
 |  |  |                                     color="textSecondary" | 
 |  |  |                                     variant="caption" | 
 |  |  |                                 > | 
 |  |  |                                     Bus No | 
 |  |  |                                     {translate('table.field.bus.busNo')} | 
 |  |  |                                 </Typography> | 
 |  |  |                                 <Typography variant="body2"> | 
 |  |  |                                     {record.busNo || '-'} | 
 |  |  | 
 |  |  |                                     color="textSecondary" | 
 |  |  |                                     variant="caption" | 
 |  |  |                                 > | 
 |  |  |                                     Action Count | 
 |  |  |                                     {translate('table.field.mission.actionCount')} | 
 |  |  |                                 </Typography> | 
 |  |  |                                 <Typography variant="body2"> | 
 |  |  |                                     {record.actionCount || 'unknown'} | 
 |  |  | 
 |  |  |                                         color="textSecondary" | 
 |  |  |                                         variant="caption" | 
 |  |  |                                     > | 
 |  |  |                                         Tasks | 
 |  |  |                                         {translate('table.field.mission.task')} | 
 |  |  |                                     </Typography> | 
 |  |  |                                     <ReferenceArrayField | 
 |  |  |                                         source="contact_ids" | 
 |  |  | 
 |  |  |                                     color="textSecondary" | 
 |  |  |                                     variant="caption" | 
 |  |  |                                 > | 
 |  |  |                                     Run Path | 
 |  |  |                                     {translate('table.field.mission.runPath')} | 
 |  |  |                                 </Typography> | 
 |  |  |                                 <Typography variant="body2" sx={{ whiteSpace: 'normal', overflow: 'hidden', display: 'flex', flexWrap: 'wrap' }}> | 
 |  |  |                                     [ {record.codeList.map((code, index) => ( | 
 |  |  | 
 |  |  |                         )} | 
 |  |  |  | 
 |  |  |                         <Box m={2}> | 
 |  |  |                             <Typography | 
 |  |  |                                 color="textSecondary" | 
 |  |  |                                 variant="caption" | 
 |  |  |                             > | 
 |  |  |                                 {translate('table.field.mission.actions')} | 
 |  |  |                             </Typography> | 
 |  |  |                             <Divider /> | 
 |  |  |                             <ActionsIterator actionIds={record.actionIds} /> | 
 |  |  |                         </Box> | 
 |  |  | 
 |  |  |     const translate = useTranslate(); | 
 |  |  |  | 
 |  |  |     const handleClick = () => { | 
 |  |  |         alert(1); | 
 |  |  |         redirect(`/mission/${record.id}/resend`, undefined, undefined, undefined, { | 
 |  |  |             _scrollToTop: false, | 
 |  |  |         }); | 
 |  |  |     }; | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <Button | 
 |  |  |             onClick={handleClick} | 
 |  |  |             startIcon={<MoveToInboxIcon />} | 
 |  |  |             // startIcon={<MoveToInboxIcon />} | 
 |  |  |             endIcon={<ArrowForwardIosIcon />} | 
 |  |  |             size="small" | 
 |  |  |         > | 
 |  |  |             {translate('common.action.resend')} |