website refactor
This commit is contained in:
44
apps/website/lib/display-objects/StatusDisplay.ts
Normal file
44
apps/website/lib/display-objects/StatusDisplay.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* StatusDisplay
|
||||
*
|
||||
* Deterministic mapping of status codes to human-readable labels.
|
||||
*/
|
||||
|
||||
export class StatusDisplay {
|
||||
/**
|
||||
* Maps transaction status to label.
|
||||
*/
|
||||
static transactionStatus(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
paid: 'Paid',
|
||||
pending: 'Pending',
|
||||
overdue: 'Overdue',
|
||||
failed: 'Failed',
|
||||
};
|
||||
return map[status] || status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps race status to label.
|
||||
*/
|
||||
static raceStatus(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
scheduled: 'Scheduled',
|
||||
running: 'Live',
|
||||
completed: 'Completed',
|
||||
};
|
||||
return map[status] || status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps protest status to label.
|
||||
*/
|
||||
static protestStatus(status: string): string {
|
||||
const map: Record<string, string> = {
|
||||
pending: 'Pending',
|
||||
under_review: 'Under Review',
|
||||
resolved: 'Resolved',
|
||||
};
|
||||
return map[status] || status;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user