forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits

schedule-status.ts34 lines, 1.2 KiBHistoryRawDownload
1/** Shared semantic colors for exam/event schedule chips (dashboard, lists, cards). */
2export type ScheduleStatus =
3 | "active"
4 | "upcoming"
5 | "today"
6 | "soon"
7 | "finished"
8 | "past"
9 | "unscheduled"
10 | "submitted";
11
12export function scheduleStatusClass(status: ScheduleStatus | string): string {
13 if (status === "active") {
14 return "border-info/30 bg-info/10 text-info-text";
15 }
16 if (status === "submitted") {
17 return "border-success/30 bg-success/10 text-success-text";
18 }
19 if (status === "today" || status === "upcoming" || status === "soon") {
20 return "border-warning/30 bg-warning/10 text-warning-text";
21 }
22 if (status === "finished" || status === "past") {
23 return "border-destructive/30 bg-destructive/10 text-destructive-text";
24 }
25 return "border-muted bg-muted/50 text-muted-foreground";
26}
27
28export function scheduleStatusDotClass(status: ScheduleStatus | string): string {
29 if (status === "active") return "bg-info";
30 if (status === "submitted") return "bg-success";
31 if (status === "today" || status === "upcoming" || status === "soon") return "bg-warning";
32 if (status === "finished" || status === "past") return "bg-destructive";
33 return "bg-muted-foreground";
34}