42 lines
927 B
TypeScript
42 lines
927 B
TypeScript
import type { Vibe } from "@/app/generated/prisma/enums";
|
|
|
|
export const VIBES = ["CHILL", "BALANCED", "HARDCORE"] as const satisfies readonly Vibe[];
|
|
|
|
interface VibeMeta {
|
|
label: string;
|
|
icon: string;
|
|
description: string;
|
|
}
|
|
|
|
const META: Record<Vibe, VibeMeta> = {
|
|
CHILL: {
|
|
label: "Chill",
|
|
icon: "😌",
|
|
description: "Santai, nikmati prosesnya, no rush.",
|
|
},
|
|
BALANCED: {
|
|
label: "Balanced",
|
|
icon: "🙂",
|
|
description: "Seimbang — ada effort, ada healing.",
|
|
},
|
|
HARDCORE: {
|
|
label: "Hardcore",
|
|
icon: "🔥",
|
|
description: "Push limit, target tercapai, full energy.",
|
|
},
|
|
};
|
|
|
|
export function vibeMeta(vibe: Vibe): VibeMeta {
|
|
return META[vibe];
|
|
}
|
|
|
|
export function vibeLabel(vibe: Vibe): string {
|
|
return META[vibe].label;
|
|
}
|
|
|
|
export function isVibe(value: unknown): value is Vibe {
|
|
return (
|
|
typeof value === "string" && (VIBES as readonly string[]).includes(value)
|
|
);
|
|
}
|