forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

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

attendance-status.ts33 lines, 1004 bytesHistoryRawDownload
1import type { CoreAttendanceStatus } from "@/api/client";
2import type { MessageKey } from "@/i18n/messages";
3
4export const ATTENDANCE_STATUSES: { value: CoreAttendanceStatus; key: MessageKey; detailKey: MessageKey; class: string }[] = [
5 {
6 value: "present",
7 key: "status.present",
8 detailKey: "status.presentDetail",
9 class: "border-success/30 bg-success/10 text-success-text",
10 },
11 {
12 value: "absent",
13 key: "status.absent",
14 detailKey: "status.absentDetail",
15 class: "border-destructive/30 bg-destructive/10 text-destructive-text",
16 },
17 {
18 value: "late",
19 key: "status.late",
20 detailKey: "status.lateDetail",
21 class: "border-warning/30 bg-warning/10 text-warning-text",
22 },
23 {
24 value: "excused",
25 key: "status.excused",
26 detailKey: "status.excusedDetail",
27 class: "border-info/30 bg-info/10 text-info-text",
28 },
29];
30
31export function getAttendanceStatusMeta(status: string) {
32 return ATTENDANCE_STATUSES.find((item) => item.value === status);
33}