"use client";

import { Badge } from "@/components/ui";
import { commercialEntityName, enumLabel } from "../presentation";

export function PlanBadge({
  label,
  status,
}: {
  label?: string | null;
  status?: string | null;
}) {
  if (!label && !status) return <Badge variant="default">بدون پلن</Badge>;
  return (
    <Badge variant={status === "active" || status === "trialing" ? "primary" : "default"}>
      {label ? commercialEntityName("plans", label, label) : enumLabel(status)}
    </Badge>
  );
}

export function CapabilityBadge({ code, label }: { code: string; label?: string }) {
  return (
    <span className="inline-flex items-center rounded-full border border-gray-200 bg-white px-2.5 py-0.5 text-xs text-secondary">
      {commercialEntityName("capabilities", code, label)}
    </span>
  );
}
