Move business logic out of App Router into module packages, add boundary validation scripts, and keep all routes as thin re-exports without changing URLs or API behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
858 B
TypeScript
27 lines
858 B
TypeScript
"use client";
|
|
|
|
import { Badge } from "@/components/ds";
|
|
import { lifecycleStatusLabels, lifecycleStatusTone } from "@/modules/sports-center/design-system/tokens";
|
|
|
|
export function SportsCenterStatusChip({ status }: { status: string }) {
|
|
const label = lifecycleStatusLabels[status] ?? memberStatusLabel(status) ?? status;
|
|
const tone = lifecycleStatusTone[status] ?? "default";
|
|
return <Badge tone={tone}>{label}</Badge>;
|
|
}
|
|
|
|
function memberStatusLabel(status: string) {
|
|
const map: Record<string, string> = {
|
|
active: "فعال",
|
|
inactive: "غیرفعال",
|
|
suspended: "معلق",
|
|
cancelled: "لغو",
|
|
frozen: "فریز",
|
|
expired: "منقضی",
|
|
pending: "در انتظار",
|
|
confirmed: "تأیید شده",
|
|
completed: "تکمیل",
|
|
no_show: "عدم حضور",
|
|
};
|
|
return map[status];
|
|
}
|