"use client";

import { Badge } from "@/components/ui/badge";
import type { EmailValidationStatus } from "@/lib/email-validation";

const LABELS: Record<EmailValidationStatus, string> = {
  valid: "صالح",
  invalid: "غير صالح",
  role_based: "بريد دوري",
  disposable: "مؤقت",
  catch_all: "Catch-all",
  unknown: "غير معروف",
};

export function EmailValidationBadge({ status }: { status?: string | null }) {
  if (!status) return null;
  const key = status as EmailValidationStatus;
  const label = LABELS[key] ?? status;
  const variant =
    key === "valid"
      ? "default"
      : key === "role_based"
        ? "secondary"
        : "warning";
  return <Badge variant={variant}>{label}</Badge>;
}
