| | |
| | | const AgvShowContent = (props) => { |
| | | const { record, isPending } = useShowContext(); |
| | | const theme = useTheme(); |
| | | const [online, setOnline] = useState(false); |
| | | |
| | | useEffect(() => { |
| | | if (record) { |
| | | setOnline(record.online) |
| | | } |
| | | }, [record]) |
| | | |
| | | if (isPending || !record) return null; |
| | | |
| | | return ( |
| | |
| | | <Stack direction='row'> |
| | | <Box mt={.8} mr={2}> |
| | | <PulseSignal |
| | | flag={record.online} |
| | | flag={online} |
| | | width={10} |
| | | negative={!record.online} |
| | | /> |
| | | </Box> |
| | | <Typography |
| | |
| | | }} |
| | | > |
| | | <TabbedShowLayout.Tab label="page.agv.show.tabs.detail"> |
| | | <AgvShowDetail agvId={record.id} /> |
| | | <AgvShowDetail agvId={record.id} setOnline={setOnline} /> |
| | | </TabbedShowLayout.Tab> |
| | | <TabbedShowLayout.Tab label="page.agv.show.tabs.task" path="tasks"> |
| | | <AgvShowTask agvId={record.id} /> |