| | |
| | | import * as React from 'react'; |
| | | import { useState } from 'react'; |
| | | import { Paper, Typography, Box } from '@mui/material'; |
| | | import { Paper, Typography, Box, Chip, Stack } from '@mui/material'; |
| | | import ContactsIcon from '@mui/icons-material/AccountCircle'; |
| | | import DealIcon from '@mui/icons-material/MonetizationOn'; |
| | | import { |
| | |
| | | Link, |
| | | useResourceContext, |
| | | } from 'react-admin'; |
| | | |
| | | import PulseSignal from '../components/PulseSignal'; |
| | | import { AgvAvatar } from './AgvAvatar'; |
| | | import { red } from '@mui/material/colors'; |
| | | |
| | | export const AgvCard = (props) => { |
| | | const resource = useResourceContext(); |
| | |
| | | const createPath = useCreatePath(); |
| | | const record = useRecordContext(props); |
| | | if (!record) return null; |
| | | |
| | | console.log(record); |
| | | |
| | | |
| | | return ( |
| | | <Link |
| | |
| | | }} |
| | | elevation={elevation} |
| | | > |
| | | <Box display="flex" flexDirection="row" alignItems="center" justifyContent='space-between'> |
| | | <PulseSignal |
| | | flag={true} |
| | | /> |
| | | <Typography variant="caption" > |
| | | vol: |
| | | <Box |
| | | component={"span"} |
| | | sx={{ |
| | | color: record.vol < record.chargeLine ? red[400] : 'inherit' |
| | | }}> |
| | | {record.vol} |
| | | </Box> |
| | | </Typography> |
| | | </Box> |
| | | <Box display="flex" flexDirection="column" alignItems="center"> |
| | | <AgvAvatar /> |
| | | <Box textAlign="center" marginTop={1}> |
| | | <Typography variant="subtitle2"> |
| | | {record.name} |
| | | {record.agvStatus} |
| | | </Typography> |
| | | <SelectField |
| | | color="textSecondary" |
| | | source="sector" |
| | | choices={[ |
| | | { id: '1', name: '1' } |
| | | ]} |
| | | /> |
| | | <Typography variant="overline" sx={{ opacity: .7 }}> |
| | | code: {record.code} |
| | | </Typography> |
| | | </Box> |
| | | </Box> |
| | | <Box display="flex" justifyContent="space-around" width="100%"> |