forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

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

appointment-status.ts21 lines, 1.0 KiBHistoryRawDownload
1/** Shared semantic colors for appointment status chips, mirroring schedule-status. */
2import type { AppointmentStatus } from "@/api/client";
3import type { MessageKey } from "@/i18n/messages";
4
5export function appointmentStatusClass(status: AppointmentStatus | string): string {
6 if (status === "pending") return "border-warning/30 bg-warning/10 text-warning-text";
7 if (status === "approved") return "border-success/30 bg-success/10 text-success-text";
8 if (status === "rejected") return "border-destructive/30 bg-destructive/10 text-destructive-text";
9 return "border-muted bg-muted/50 text-muted-foreground";
10}
11
12export function appointmentStatusDotClass(status: AppointmentStatus | string): string {
13 if (status === "pending") return "bg-warning";
14 if (status === "approved") return "bg-success";
15 if (status === "rejected") return "bg-destructive";
16 return "bg-muted-foreground";
17}
18
19export function appointmentStatusLabelKey(status: AppointmentStatus): MessageKey {
20 return `appointments.status.${status}` as MessageKey;
21}