- Next.js 16 App Router site with the ANOUMA design system - Payload CMS (PostgreSQL) for offers, events, posts and page content - WebRTC video-call system with custom signaling server - SMTP email reminders and booking-request notifications - Customer accounts, calendar-based availability, and booking workflow
24 lines
1013 B
TypeScript
24 lines
1013 B
TypeScript
const statusStyles: Record<string, { label: string; className: string }> = {
|
|
pending: { label: "Vorgeschlagen", className: "bg-anouma-sand/60 text-anouma-plum" },
|
|
confirmed: { label: "Bestätigt", className: "bg-anouma-sage/30 text-anouma-moss" },
|
|
rejected: { label: "Abgelehnt", className: "bg-red-100 text-red-800" },
|
|
cancelled: { label: "Storniert", className: "bg-anouma-taupe/30 text-anouma-plum/70" },
|
|
past: { label: "Vergangen", className: "bg-anouma-taupe/20 text-anouma-plum/60" },
|
|
};
|
|
|
|
export function BookingStatusBadge({ status }: { status: string }) {
|
|
const style = statusStyles[status] ?? statusStyles.pending;
|
|
return (
|
|
<span className={`inline-flex items-center rounded-full px-3 py-1 text-xs font-medium ${style.className}`}>
|
|
{style.label}
|
|
</span>
|
|
);
|
|
}
|
|
|
|
export function resolveDisplayStatus(status: string, dateISO: string): string {
|
|
if ((status === "pending" || status === "confirmed") && new Date(dateISO) < new Date()) {
|
|
return "past";
|
|
}
|
|
return status;
|
|
}
|