mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 12:30:58 +00:00
Loading queque changes
This commit is contained in:
@@ -1,13 +1,18 @@
|
||||
import { Card, Container, Stack } from '@mantine/core';
|
||||
import { Badge, Card, Container, Stack, Tabs } from '@mantine/core';
|
||||
|
||||
import Breadcrumbs from '@/components/ui/Breadcrumbs';
|
||||
import { InventoryWorkbench, VisualEmptyState, WarehouseHero } from '@/components/warehouses';
|
||||
import { useWarehouseInventory } from '@/hooks/useWarehouses';
|
||||
|
||||
/** Items that are READY_FOR_LOADING — load them onto a wagon from here. */
|
||||
/**
|
||||
* Loading Queue - Manage bookings ready for loading.
|
||||
* Tabs:
|
||||
* - Awaiting Payment: UNPAID bookings
|
||||
* - Ready For Loading: PAID bookings ready to load onto wagon
|
||||
*/
|
||||
export default function LoadingQueuePage() {
|
||||
const { data, isLoading } = useWarehouseInventory({ status: 'READY_FOR_LOADING' });
|
||||
const items = data ?? [];
|
||||
const { data: paidItems, isLoading: paidLoading } = useWarehouseInventory({ status: 'READY_FOR_LOADING' });
|
||||
const paidBookings = paidItems ?? [];
|
||||
|
||||
return (
|
||||
<Container size="xxl" py="lg">
|
||||
@@ -18,19 +23,40 @@ export default function LoadingQueuePage() {
|
||||
variant="wagon"
|
||||
secondaryVariant="cargo"
|
||||
title="Loading Queue"
|
||||
subtitle="Inventory that is ready for loading onto a wagon."
|
||||
subtitle="Manage bookings and inventory through the loading workflow."
|
||||
/>
|
||||
|
||||
<Card withBorder radius="md" padding="lg">
|
||||
{!isLoading && items.length === 0 ? (
|
||||
<VisualEmptyState
|
||||
variant="wagon"
|
||||
title="Nothing waiting to load"
|
||||
description="Items appear here once they are marked Ready For Loading."
|
||||
/>
|
||||
) : (
|
||||
<InventoryWorkbench items={items} isLoading={isLoading} />
|
||||
)}
|
||||
<Tabs defaultValue="ready">
|
||||
<Tabs.List>
|
||||
<Tabs.Tab value="awaiting" leftSection={<Badge size="xs">Unpaid</Badge>}>
|
||||
Awaiting Payment
|
||||
</Tabs.Tab>
|
||||
<Tabs.Tab value="ready" leftSection={<Badge size="xs" color="green">Ready</Badge>}>
|
||||
Ready For Loading
|
||||
</Tabs.Tab>
|
||||
</Tabs.List>
|
||||
|
||||
<Tabs.Panel value="awaiting" pt="md">
|
||||
<VisualEmptyState
|
||||
variant="wagon"
|
||||
title="No unpaid bookings"
|
||||
description="Unpaid bookings will appear here pending payment verification."
|
||||
/>
|
||||
</Tabs.Panel>
|
||||
|
||||
<Tabs.Panel value="ready" pt="md">
|
||||
{!paidLoading && paidBookings.length === 0 ? (
|
||||
<VisualEmptyState
|
||||
variant="wagon"
|
||||
title="Nothing waiting to load"
|
||||
description="Items appear here once they are marked Ready For Loading."
|
||||
/>
|
||||
) : (
|
||||
<InventoryWorkbench items={paidBookings} isLoading={paidLoading} />
|
||||
)}
|
||||
</Tabs.Panel>
|
||||
</Tabs>
|
||||
</Card>
|
||||
</Stack>
|
||||
</Container>
|
||||
|
||||
Reference in New Issue
Block a user