import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { Grid, Stack, Button, IconButton, Typography, Box, TextField, MenuItem, Chip, Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from '@mui/material'; import ArrowBackIcon from '@mui/icons-material/ArrowBack'; import AutorenewIcon from '@mui/icons-material/Autorenew'; import Inventory2OutlinedIcon from '@mui/icons-material/Inventory2Outlined'; import TwoWheelerOutlinedIcon from '@mui/icons-material/TwoWheelerOutlined'; import MapOutlinedIcon from '@mui/icons-material/MapOutlined'; import RouteOutlinedIcon from '@mui/icons-material/RouteOutlined'; import PersonAddAltOutlinedIcon from '@mui/icons-material/PersonAddAltOutlined'; import PageHeader from '@/components/PageHeader'; import StatCard from '@/components/StatCard'; import MainCard from '@/components/MainCard'; import StatusChip from '@/components/StatusChip'; import UserAvatar from '@/components/UserAvatar'; import { orders, riders } from '@/data/mock'; import { inr } from '@/utils/format'; const ZONES = ['Zone A', 'Zone B', 'Zone C', 'Zone D']; const PROFIT = [42, 58, 36, 50, 28, 64]; // derive assignment rows from orders + riders mock const ROWS = orders.slice(0, 6).map((o, i) => ({ ...o, zone: ZONES[i % ZONES.length], rider: riders[i % riders.length].name, profit: PROFIT[i % PROFIT.length] })); export default function AssignOrders() { const navigate = useNavigate(); const [payment, setPayment] = useState('all'); const [rider, setRider] = useState('auto'); return ( <> navigate('/orders')} size="small"> Assign Orders } breadcrumbs={[{ label: 'Orders', to: '/orders' }, { label: 'Assign Orders' }]} action={ } /> # Zone Tenant Order Location Pickup Delivery Notes Rider Type Profit Charges KMS {ROWS.map((r) => ( {r.id} {r.tenant} {r.location} {r.pickup} {r.drop} {r.notes || '—'} {r.rider} {inr(r.profit)} {inr(r.charges)} {r.kms} ))}
setPayment(e.target.value)}> All Payments Prepaid COD setRider(e.target.value)}> Auto Assign {riders.map((rd) => {rd.name})} ); }