"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];
}
