mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 13:40:57 +00:00
add contract clearance detail page and enhance contract requests filtering and ui fix
This commit is contained in:
@@ -197,6 +197,29 @@ function DirectionIcon({ direction }: { direction: string }) {
|
||||
}
|
||||
|
||||
function StatusBadge({ row }: { row: ClearanceRow }) {
|
||||
// Terminal contracts stay listed as history — badge the terminal state
|
||||
// instead of falling through to "Under review".
|
||||
if (["EXPIRED", "CANCELLED", "REJECTED"].includes(row.status)) {
|
||||
return (
|
||||
<Tooltip
|
||||
label="This contract is no longer active — kept here for clearance history."
|
||||
withArrow
|
||||
>
|
||||
<Badge
|
||||
size="sm"
|
||||
variant="light"
|
||||
color={row.status === "EXPIRED" ? "orange" : "red"}
|
||||
radius="sm"
|
||||
>
|
||||
{row.status === "EXPIRED"
|
||||
? "Contract expired"
|
||||
: row.status === "CANCELLED"
|
||||
? "Cancelled"
|
||||
: "Rejected"}
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
if (row.paymentExpired) {
|
||||
return (
|
||||
<Tooltip
|
||||
@@ -817,6 +840,17 @@ const shipmentStatusColor = (s: string) => {
|
||||
if (s === "AWAITING_DOCUMENTS") return "yellow";
|
||||
if (s === "DOCUMENTS_UNDER_REVIEW") return "blue";
|
||||
if (s === "CLEARANCE_READY") return "edr-green";
|
||||
if (
|
||||
[
|
||||
"SELECTED_FOR_BATCH",
|
||||
"PNR_GENERATED",
|
||||
"AWAITING_PAYMENT",
|
||||
"PAYMENT_VERIFICATION_IN_PROGRESS",
|
||||
].includes(s)
|
||||
)
|
||||
return "violet";
|
||||
if (s === "EXPIRED") return "orange";
|
||||
if (s === "CANCELLED" || s === "REJECTED") return "red";
|
||||
return "gray";
|
||||
};
|
||||
|
||||
|
||||
@@ -106,6 +106,18 @@ function statusColor(status: string): string {
|
||||
case "ACTIVE_SHIPMENT_IN_PROGRESS":
|
||||
case "IN_TRANSIT":
|
||||
return "teal";
|
||||
// Payment phase — booking selected / awaiting the customer's payment.
|
||||
case "SELECTED_FOR_BATCH":
|
||||
case "PNR_GENERATED":
|
||||
case "AWAITING_PAYMENT":
|
||||
case "PAYMENT_VERIFICATION_IN_PROGRESS":
|
||||
return "violet";
|
||||
// Terminal rows kept as clearance history.
|
||||
case "EXPIRED":
|
||||
return "orange";
|
||||
case "CANCELLED":
|
||||
case "REJECTED":
|
||||
return "red";
|
||||
default:
|
||||
return "gray";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user