import { Badge, Divider, Group, Modal, SimpleGrid, Stack, Text } from '@mantine/core'; import type { InventoryInquiryResult } from '@/types/warehouse'; import { InventoryStatusBadge } from './badges'; import { formatDate, formatNumber } from './options'; interface InventoryInquiryDetailModalProps { opened: boolean; onClose: () => void; result: InventoryInquiryResult | null; } function DetailRow({ label, value }: { label: string; value: React.ReactNode }) { return ( {label} {value || '-'} ); } function itemLabel(result: InventoryInquiryResult) { if (result.containerNumber) return `Container ${result.containerNumber}`; if (result.cargoType) return result.cargoType; if (result.cargoDescription) return result.cargoDescription; if (result.goodsId) return `Goods ${result.goodsId}`; return '-'; } export function InventoryInquiryDetailModal({ opened, onClose, result }: InventoryInquiryDetailModalProps) { return ( {!result ? ( No inquiry result selected. ) : ( {result.bookingReference ?? result.bookingNumber ?? result.bookingId ?? result.id} Inventory ID: {result.inventoryId ?? 'Not yet in warehouse inventory'} {result.status ? ( ) : ( {result.trainStatus ?? result.bookingStatus ?? 'Not in warehouse'} )} )} ); }