import { BadgeVariant } from "@/components/ui/badge/badge";
import { CheckCircle } from "lucide-react";

export type LocationType = "Office" | "Plant" | "Warehouse";

export const categoryBadgeColor = (
  category: string
): BadgeVariant => {
  switch (category) {
    case "Founder":
      return "success";

    case "Family Member":
      return "light";

    case "Corporate":
      return "primary";

    case "Investor":
      return "info";

    case "Public":
      return "dark";

    default:
      return "light";
  }
};

export const sboBadgeColor = (
  value: string
): BadgeVariant => {
  return value === "Yes" ? "success" : "error";
};

export const chargeTypeBadgeColor = (
  value: string
): BadgeVariant => {
  switch (value) {
    case "1ST PARI PASSU":
      return "success";

    case "2ND PARI PASSU":
      return "info";

    case "HYPOTHECATION":
      return "primary";

    default:
      return "light";
  }
};

export const insuranceStatusBadgeColor = (
  daysLeft: number
): BadgeVariant => {
  if (daysLeft < 90) return "warning";

  return "success";
};


export const getCategoryBadgeColor = (
  category: string,
): BadgeVariant => {
  switch (category) {
    case "Founder":
      return "success";

    case "Family Member":
      return "light";

    case "Corporate":
      return "primary";

    case "Investor":
      return "info";

    case "Public":
      return "error";

    case "Fund":
      return "pink";

    case "Syndicate":
      return "sky";

    case "Beneficiary":
      return "cyan";

    case "Settlor & Beneficiary":
      return "teal";

    case "Co-Investor":
      return "lime";

    default:
      return "orange";
  }
};

export const locationTypeBadgeColor = (
  type: string
): BadgeVariant => {
  switch (type) {
    case "Office":
      return "info";     // blue

    case "Plant":
      return "success";  // green

    case "Warehouse":
      return "primary";  // purple

    default:
      return "light";
  }
};

export const renderSBO = (value: string) =>
  value === "Yes" ? <CheckCircle size={18} className="text-green-600" /> : null;