Fix server/client component boundary issue with reasonColor/reasonLabel helper functions by moving them to shared utils
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { AbsenceReason } from "@prisma/client";
|
||||
|
||||
export function reasonLabel(reason: AbsenceReason) {
|
||||
if (reason === AbsenceReason.ILLNESS) return "Krank";
|
||||
if (reason === AbsenceReason.VACATION) return "Urlaub";
|
||||
return "Sonstiges";
|
||||
}
|
||||
|
||||
export function reasonColor(reason: AbsenceReason) {
|
||||
if (reason === AbsenceReason.ILLNESS) return "var(--danger)";
|
||||
if (reason === AbsenceReason.VACATION) return "var(--warn)";
|
||||
return "var(--accent)";
|
||||
}
|
||||
Reference in New Issue
Block a user