import { format } from 'date-fns'; import PropTypes from 'prop-types'; import ArrowRightIcon from '@heroicons/react/24/solid/ArrowRightIcon'; import ArrowTopRightOnSquareIcon from '@heroicons/react/24/solid/ArrowTopRightOnSquareIcon'; import { Box, Button, Card, CardActions, CardHeader, Divider, SvgIcon, Table, TableBody, TableCell, TableHead, TableRow } from '@mui/material'; import { Scrollbar } from 'src/components/scrollbar'; import { SeverityPill } from 'src/components/severity-pill'; import { useRouter } from 'next/router'; const statusMap = { 1: 'warning', 0: 'success', 2: 'error' }; const status = (s)=>{ if (s == 0){ return "Online" } else if (s == 1){ return "Associating" }else if (s==2){ return "Offline" }else { return "Unknown" } } export const OverviewLatestOrders = (props) => { const { orders = [], sx } = props; const router = useRouter() return ( Serial Number Model Vendor Version Status Access {orders.map((order) => { return ( {order.SN} {order.Model} {order.Vendor} {order.Version} {status(order.Status)} router.push("devices/"+order.SN)} > ); })}
{/* */}
); }; OverviewLatestOrders.prototype = { orders: PropTypes.array, sx: PropTypes.object };