-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContestStatus.types.ts
More file actions
68 lines (64 loc) · 2.13 KB
/
ContestStatus.types.ts
File metadata and controls
68 lines (64 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
export enum Status {
UPCOMING = "UPCOMING",
LIVE = "LIVE",
ENDED = "ENDED",
}
export interface ContestStatusProps {
/** Status indicator for the current contest. */
status?: Status;
/** Audit status. */
auditStatus?: AuditStatus | null;
/** String of custom classes to extend the default styling of the component. */
className?: string;
/** HTML element identifier */
id?: string;
}
export const AuditStatus = {
Booking: "Booking",
PreAudit: "Pre-Audit",
Active: "Active",
/** Paused: The audit is in between Rolling Triage cohorts */
Paused: "Paused",
Triage: "Triage",
Review: "Review",
Restricted: "Restricted",
Judging: "Judging",
PJQA: "Post-Judging QA",
JudgingComplete: "Judging Complete",
Awarding: "Awarding",
Reporting: "Reporting",
Completed: "Completed",
LostDeal: "Lost Deal",
LiveJudging: "LiveJudging",
} as const;
// Take the AuditStatus object, and make a string literal type of the values
export type AuditStatus = (typeof AuditStatus)[keyof typeof AuditStatus];
export enum AuditPublicStage {
Active = "Active",
Upcoming = "Upcoming",
SubsClosed = "Submissions closed",
Completed = "Completed",
LiveJudging = "Live Judging",
}
// Grouping mapping of the audit statuses to the public stages
export const MapAuditStatusToAuditPublicStage: Record<
AuditStatus,
AuditPublicStage | null
> = {
[AuditStatus.PreAudit]: AuditPublicStage.Upcoming,
[AuditStatus.Active]: AuditPublicStage.Active,
[AuditStatus.Awarding]: AuditPublicStage.SubsClosed,
[AuditStatus.Judging]: AuditPublicStage.SubsClosed,
[AuditStatus.PJQA]: AuditPublicStage.SubsClosed,
[AuditStatus.Reporting]: AuditPublicStage.SubsClosed,
[AuditStatus.Review]: AuditPublicStage.SubsClosed,
[AuditStatus.Triage]: AuditPublicStage.SubsClosed,
[AuditStatus.Restricted]: AuditPublicStage.SubsClosed,
[AuditStatus.JudgingComplete]: AuditPublicStage.SubsClosed,
[AuditStatus.Paused]: AuditPublicStage.SubsClosed,
[AuditStatus.Completed]: AuditPublicStage.Completed,
[AuditStatus.LiveJudging]: AuditPublicStage.LiveJudging,
// Excluded statuses:
[AuditStatus.LostDeal]: null,
[AuditStatus.Booking]: null,
};