import { IdentityCardData } from "@/lib/id/repository"; import { formatDate } from "@/lib/utils"; import Image from "next/image"; import { Button } from "./ui/button"; import { Menu } from "lucide-react"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; type DialogField = { key: keyof IdentityCardData; label: string; }; const DIALOG_FIELDS: DialogField[] = [ { key: "sex", label: "Sex" }, { key: "birthDate", label: "Date of birth" }, { key: "authority", label: "Authority" }, { key: "nationality", label: "Nationality" }, { key: "issueDate", label: "Date of issue" }, { key: "expiryDate", label: "Date of expiry" }, { key: "issuingCountry", label: "Issuing country" }, { key: "origin", label: "Place of origin" }, { key: "height", label: "Height" }, { key: "eyeColor", label: "Eye color" }, ]; const ADDRESS_FIELD: DialogField = { key: "address", label: "Address" }; function formatFieldValue(key: keyof IdentityCardData, value: unknown) { if (value instanceof Date) return formatDate(value); if (value == null) return "—"; if (key === "height") return `${value} cm`; return String(value); } function CardPattern() { return ( ); } export default function IdCard({ data }: { data: IdentityCardData }) { return (