mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 00:52:50 +00:00
fix
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
ArrowRight,
|
||||
Eye,
|
||||
MoreHorizontal,
|
||||
Printer,
|
||||
RefreshCw,
|
||||
Truck,
|
||||
} from "lucide-react";
|
||||
@@ -313,6 +314,11 @@ const LastMilePage = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const handlePrintTripSlip = (job: LastMileJob) => {
|
||||
// Placeholder — wire to the trip-slip document service when available.
|
||||
toast({ title: "Printing trip slip", description: job.bookingRef });
|
||||
};
|
||||
|
||||
const columns = useMemo((): ColumnDef<LastMileJob>[] => {
|
||||
const headerClassName = ruleEngineTable.headerCell;
|
||||
const cellClassName = ruleEngineTable.bodyCell;
|
||||
@@ -386,6 +392,9 @@ const LastMilePage = () => {
|
||||
cell: ({ row }) => {
|
||||
const isAssigned = row.original.status === "ASSIGNED";
|
||||
const nextStatus = NEXT_DELIVERY_STATUS[row.original.deliveryStatus];
|
||||
const canPrintTripSlip =
|
||||
row.original.deliveryStatus === "READY_TO_TRANSIT" ||
|
||||
row.original.deliveryStatus === "DELIVERED";
|
||||
return (
|
||||
<Group gap={4} justify="flex-end" wrap="nowrap">
|
||||
<Menu position="bottom-end" width={200} withinPortal>
|
||||
@@ -426,6 +435,14 @@ const LastMilePage = () => {
|
||||
>
|
||||
View detail
|
||||
</Menu.Item>
|
||||
{canPrintTripSlip && (
|
||||
<Menu.Item
|
||||
leftSection={<Printer size={15} />}
|
||||
onClick={() => handlePrintTripSlip(row.original)}
|
||||
>
|
||||
Print trip slip
|
||||
</Menu.Item>
|
||||
)}
|
||||
</Menu.Dropdown>
|
||||
</Menu>
|
||||
</Group>
|
||||
|
||||
Reference in New Issue
Block a user