mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 21:08:12 +00:00
fix issue
This commit is contained in:
@@ -72,19 +72,39 @@ function apiErrorMessage(error: unknown, fallback: string): string {
|
||||
*/
|
||||
function phaseCountdown(
|
||||
schedule: TrainScheduleDetail,
|
||||
): { label: string; deadline: string } | null {
|
||||
): { label: string; deadline: string; expiredText: string } | null {
|
||||
switch (schedule.windowPhase) {
|
||||
case "PRE_WINDOW":
|
||||
return schedule.windowOpensAt
|
||||
? {
|
||||
label: "Booking window opens in",
|
||||
deadline: schedule.windowOpensAt,
|
||||
expiredText: "Booking opening now…",
|
||||
}
|
||||
: null;
|
||||
case "OPEN":
|
||||
return schedule.windowClosesAt
|
||||
? { label: "Booking window closes in", deadline: schedule.windowClosesAt }
|
||||
? {
|
||||
label: "Booking window closes in",
|
||||
deadline: schedule.windowClosesAt,
|
||||
expiredText: "Document review starting…",
|
||||
}
|
||||
: null;
|
||||
case "DOC_REVIEW":
|
||||
return schedule.docReviewEndsAt
|
||||
? { label: "Document review ends in", deadline: schedule.docReviewEndsAt }
|
||||
? {
|
||||
label: "Document review ends in",
|
||||
deadline: schedule.docReviewEndsAt,
|
||||
expiredText: "Payment starting…",
|
||||
}
|
||||
: null;
|
||||
case "PAYMENT":
|
||||
return schedule.paymentPhaseEndsAt
|
||||
? { label: "Payment window ends in", deadline: schedule.paymentPhaseEndsAt }
|
||||
? {
|
||||
label: "Payment window ends in",
|
||||
deadline: schedule.paymentPhaseEndsAt,
|
||||
expiredText: "Payment window closing…",
|
||||
}
|
||||
: null;
|
||||
default:
|
||||
return null;
|
||||
@@ -523,7 +543,12 @@ export function ScheduleWorkspacePanel({
|
||||
border: "1px solid var(--mantine-color-blue-2)",
|
||||
}}
|
||||
>
|
||||
<CountdownTimer deadline={cd.deadline} label={cd.label} size="sm" />
|
||||
<CountdownTimer
|
||||
deadline={cd.deadline}
|
||||
label={cd.label}
|
||||
expiredText={cd.expiredText}
|
||||
size="sm"
|
||||
/>
|
||||
</Group>
|
||||
) : null;
|
||||
})()}
|
||||
|
||||
Reference in New Issue
Block a user