"use client";

import React, { useState } from "react";
import Link from "next/link";
import {
  FileCheck2,
  Search,
  RotateCcw,
  Eye,
  CheckCircle2,
  XCircle,
  AlertTriangle,
  Download,
  Hospital,
  UserCheck,
  Calendar,
  FileText,
  Sliders,
  Award,
  RefreshCw,
  History,
  ShieldCheck,
  HeartPulse,
  Clock,
  ExternalLink,
  ChevronLeft,
  ChevronRight,
  Filter,
} from "lucide-react";
import { toast } from "sonner";

interface CertificateRecord {
  id: string;
  certNumber: string;
  rollNumber: string;
  studentName: string;
  batch: string;
  hospitalName: string;
  doctorName: string;
  doctorRegNo: string;
  issueDate: string;
  submissionDate: string;
  daysLate: number;
  diagnosis: string;
  restDays: number;
  status: "Verified" | "Pending" | "Flagged" | "Rejected";
  fileUrl: string;
}

const initialCertificates: CertificateRecord[] = [
  {
    id: "cert-01",
    certNumber: "CERT-2026-103-HOSPITAL.pdf",
    rollNumber: "2441112003",
    studentName: "Chirag Banerjee",
    batch: "B.Sc H&HA Sem-IV",
    hospitalName: "Apollo Multispeciality Hospitals, Kolkata",
    doctorName: "Dr. Sandip Sengupta (MD)",
    doctorRegNo: "WBMC-68492",
    issueDate: "2026-10-01",
    submissionDate: "2026-10-04",
    daysLate: 0,
    diagnosis: "Acute Viral Gastroenteritis with severe dehydration",
    restDays: 3,
    status: "Verified",
    fileUrl: "/mock-docs/cert-103.pdf",
  },
  {
    id: "cert-02",
    certNumber: "CERT-2026-105-DENTAL.pdf",
    rollNumber: "2441112005",
    studentName: "Farhan Ahmed",
    batch: "B.Sc H&HA Sem-IV",
    hospitalName: "Government Dental College & Hospital",
    doctorName: "Dr. Meenakshi Sundaram (MDS)",
    doctorRegNo: "DCI-14280",
    issueDate: "2026-09-20",
    submissionDate: "2026-09-22",
    daysLate: 0,
    diagnosis: "Surgical extraction of impacted mandibular molar (Tooth #38)",
    restDays: 2,
    status: "Verified",
    fileUrl: "/mock-docs/cert-105.pdf",
  },
  {
    id: "cert-03",
    certNumber: "CERT-2026-109-CLINIC.pdf",
    rollNumber: "2441112009",
    studentName: "Jayant Verma",
    batch: "B.Sc H&HA Sem-VI",
    hospitalName: "City Care Family PolyClinic",
    doctorName: "Dr. K. R. Sharma (MBBS)",
    doctorRegNo: "MCI-88310",
    issueDate: "2026-09-10",
    submissionDate: "2026-09-17",
    daysLate: 1,
    diagnosis: "Typhoid fever (Salmonella enterica serovar Typhi pos)",
    restDays: 8,
    status: "Pending",
    fileUrl: "/mock-docs/cert-109.pdf",
  },
  {
    id: "cert-04",
    certNumber: "CERT-2026-115-PRIVATE.pdf",
    rollNumber: "2441112015",
    studentName: "Rohan Mukherjee",
    batch: "B.Sc H&HA Sem-II",
    hospitalName: "Private Homeopathic Dispensary",
    doctorName: "Dr. B. Das",
    doctorRegNo: "UNVERIFIED-HOMEO",
    issueDate: "2026-08-14",
    submissionDate: "2026-09-08",
    daysLate: 21,
    diagnosis: "Chronic Fatigue Syndrome",
    restDays: 3,
    status: "Rejected",
    fileUrl: "/mock-docs/cert-115.pdf",
  },
  {
    id: "cert-05",
    certNumber: "CERT-2026-121-ORTHO.pdf",
    rollNumber: "2441112022",
    studentName: "Ananya Iyer",
    batch: "B.Sc H&HA Sem-II",
    hospitalName: "Fortis Memorial Institute",
    doctorName: "Dr. Rajiv Singhal (MS Ortho)",
    doctorRegNo: "DMC-44912",
    issueDate: "2026-10-06",
    submissionDate: "2026-10-08",
    daysLate: 0,
    diagnosis: "Grade II Lateral Ankle Ligament Sprain - Non-weight bearing",
    restDays: 5,
    status: "Pending",
    fileUrl: "/mock-docs/cert-121.pdf",
  },
];

export default function MedicalCertificatesPage() {
  const [certificates, setCertificates] = useState<CertificateRecord[]>(initialCertificates);
  const [searchQuery, setSearchQuery] = useState("");
  const [statusFilter, setStatusFilter] = useState("All Status");
  const [selectedCert, setSelectedCert] = useState<CertificateRecord | null>(null);

  const filteredCerts = certificates.filter((c) => {
    const matchesStatus = statusFilter === "All Status" || c.status === statusFilter;
    const matchesSearch =
      searchQuery === "" ||
      c.studentName.toLowerCase().includes(searchQuery.toLowerCase()) ||
      c.rollNumber.includes(searchQuery) ||
      c.certNumber.toLowerCase().includes(searchQuery.toLowerCase()) ||
      c.hospitalName.toLowerCase().includes(searchQuery.toLowerCase()) ||
      c.doctorName.toLowerCase().includes(searchQuery.toLowerCase());
    return matchesStatus && matchesSearch;
  });

  const handleVerify = (id: string) => {
    setCertificates((prev) =>
      prev.map((c) => (c.id === id ? { ...c, status: "Verified" } : c))
    );
    if (selectedCert?.id === id) {
      setSelectedCert((prev) => (prev ? { ...prev, status: "Verified" } : null));
    }
    toast.success("Medical certificate endorsed by CMO and marked as Verified");
  };

  const handleReject = (id: string) => {
    setCertificates((prev) =>
      prev.map((c) => (c.id === id ? { ...c, status: "Rejected" } : c))
    );
    if (selectedCert?.id === id) {
      setSelectedCert((prev) => (prev ? { ...prev, status: "Rejected" } : null));
    }
    toast.error("Medical certificate marked as Rejected");
  };

  const navTabs = [
    { label: "Requests", href: "/admin/adjustments/medical", icon: HeartPulse, active: false },
    { label: "Certificate Reference", href: "/admin/adjustments/medical/certificates", icon: FileCheck2, active: true },
    { label: "Approvals", href: "/admin/adjustments/medical/approvals", icon: CheckCircle2, active: false },
    { label: "Configurable %", href: "/admin/adjustments/medical/policy", icon: Sliders, active: false },
    { label: "Condonations", href: "/admin/adjustments/condonation", icon: FileText, active: false },
    { label: "Approved Hours", href: "/admin/adjustments/approved", icon: Award, active: false },
    { label: "Recalculation", href: "/admin/adjustments/recalculation", icon: RefreshCw, active: false },
    { label: "History", href: "/admin/adjustments/history", icon: History, active: false },
    { label: "Audit Trail", href: "/admin/adjustments/audit-trail", icon: ShieldCheck, active: false },
  ];

  return (
    <div className="space-y-6 pb-12 font-sans bg-[#F8FAFC] min-h-screen">
      {/* 1. Breadcrumb & Header */}
      <div>
        <div className="flex items-center gap-2 text-xs text-[#64748B] mb-2 font-medium">
          <Link href="/admin/dashboard" className="hover:text-[#1769E8] transition-colors">
            Home
          </Link>
          <span>&gt;</span>
          <Link href="/admin/adjustments/medical" className="hover:text-[#1769E8] transition-colors">
            Medical & Condonation
          </Link>
          <span>&gt;</span>
          <span className="text-[#071A4D] font-semibold">Medical Certificate Reference</span>
        </div>

        <div className="flex flex-col md:flex-row md:items-center justify-between gap-4">
          <div>
            <h1 className="text-3xl font-bold font-heading text-[#071A4D] tracking-tight">
              Medical Certificate Reference
            </h1>
            <p className="text-[15px] text-[#64748B] mt-1 font-normal">
              Digital repository for authenticated medical certificates, doctor council registration numbers, and CMO endorsement validation.
            </p>
          </div>

          <div className="flex items-center gap-2">
            <button
              onClick={() => toast.success("Exporting certificate ledger to Excel...")}
              className="px-4 py-2 bg-white border border-[#E2E8F0] rounded-lg text-sm font-medium text-[#334155] hover:bg-slate-50 transition-colors flex items-center gap-2 shadow-xs cursor-pointer"
            >
              <Download className="w-4 h-4 text-[#1769E8]" />
              <span>Export Ledger</span>
            </button>
          </div>
        </div>
      </div>

      {/* 2. Subcategory Navigation Tabs */}
      <div className="flex items-center gap-1.5 overflow-x-auto pb-1 border-b border-[#E2E8F0]">
        {navTabs.map((tab) => {
          const Icon = tab.icon;
          return (
            <Link
              key={tab.href}
              href={tab.href}
              className={`flex items-center gap-1.5 px-3 py-2 rounded-lg text-xs font-semibold whitespace-nowrap transition-all ${
                tab.active
                  ? "bg-[#081A2E] text-white shadow-xs"
                  : "bg-white text-[#64748B] hover:text-[#071A4D] hover:bg-slate-100 border border-[#E2E8F0]"
              }`}
            >
              <Icon className="w-3.5 h-3.5" />
              <span>{tab.label}</span>
            </Link>
          );
        })}
      </div>

      {/* 3. Metric KPI Cards */}
      <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
        <div className="bg-white p-4 rounded-xl border border-[#E5EAF0] shadow-xs flex items-center gap-3.5">
          <div className="w-10 h-10 rounded-lg bg-blue-50 border border-blue-200 flex items-center justify-center text-[#1769E8]">
            <FileCheck2 className="w-5 h-5" />
          </div>
          <div>
            <div className="text-[11px] font-semibold text-[#64748B] uppercase tracking-wider">
              Total Documents
            </div>
            <div className="text-xl font-bold font-heading text-[#071A4D]">
              {certificates.length} Files
            </div>
          </div>
        </div>

        <div className="bg-white p-4 rounded-xl border border-[#E5EAF0] shadow-xs flex items-center gap-3.5">
          <div className="w-10 h-10 rounded-lg bg-emerald-50 border border-emerald-200 flex items-center justify-center text-emerald-600">
            <CheckCircle2 className="w-5 h-5" />
          </div>
          <div>
            <div className="text-[11px] font-semibold text-[#64748B] uppercase tracking-wider">
              CMO Verified
            </div>
            <div className="text-xl font-bold font-heading text-emerald-700">
              {certificates.filter((c) => c.status === "Verified").length} Endorsed
            </div>
          </div>
        </div>

        <div className="bg-white p-4 rounded-xl border border-[#E5EAF0] shadow-xs flex items-center gap-3.5">
          <div className="w-10 h-10 rounded-lg bg-amber-50 border border-amber-200 flex items-center justify-center text-amber-600">
            <Clock className="w-5 h-5" />
          </div>
          <div>
            <div className="text-[11px] font-semibold text-[#64748B] uppercase tracking-wider">
              Pending Validation
            </div>
            <div className="text-xl font-bold font-heading text-amber-700">
              {certificates.filter((c) => c.status === "Pending").length} Awaiting
            </div>
          </div>
        </div>

        <div className="bg-white p-4 rounded-xl border border-[#E5EAF0] shadow-xs flex items-center gap-3.5">
          <div className="w-10 h-10 rounded-lg bg-rose-50 border border-rose-200 flex items-center justify-center text-rose-600">
            <AlertTriangle className="w-5 h-5" />
          </div>
          <div>
            <div className="text-[11px] font-semibold text-[#64748B] uppercase tracking-wider">
              Window Lapsed (&gt;7d)
            </div>
            <div className="text-xl font-bold font-heading text-rose-700">
              {certificates.filter((c) => c.daysLate > 0).length} Overdue
            </div>
          </div>
        </div>
      </div>

      {/* 4. Filter Bar */}
      <div className="bg-white rounded-xl border border-[#E5EAF0] shadow-xs p-4">
        <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-12 gap-3.5 items-end">
          <div className="lg:col-span-3">
            <label className="block text-[11px] font-semibold text-[#64748B] uppercase tracking-wider mb-1.5">
              CMO Status
            </label>
            <select
              value={statusFilter}
              onChange={(e) => setStatusFilter(e.target.value)}
              className="w-full bg-white border border-[#E2E8F0] text-sm text-[#0F172A] rounded-lg px-3 py-2 font-medium focus:ring-2 focus:ring-[#1769E8]/20 focus:border-[#1769E8] outline-none transition-all cursor-pointer"
            >
              <option>All Status</option>
              <option>Verified</option>
              <option>Pending</option>
              <option>Rejected</option>
            </select>
          </div>

          <div className="lg:col-span-7">
            <label className="block text-[11px] font-semibold text-[#64748B] uppercase tracking-wider mb-1.5">
              Search Document or Provider
            </label>
            <div className="relative">
              <Search className="w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-[#94A3B8]" />
              <input
                type="text"
                value={searchQuery}
                onChange={(e) => setSearchQuery(e.target.value)}
                placeholder="Search certificate filename, roll number, doctor name, or hospital..."
                className="w-full pl-9 pr-3 py-2 bg-white border border-[#E2E8F0] text-sm text-[#0F172A] placeholder:text-[#94A3B8] rounded-lg focus:ring-2 focus:ring-[#1769E8]/20 focus:border-[#1769E8] outline-none transition-all"
              />
            </div>
          </div>

          <div className="lg:col-span-2 flex items-center gap-2">
            <button
              onClick={() => toast.success(`Found ${filteredCerts.length} certificates`)}
              className="flex-1 bg-[#1769E8] hover:bg-[#1255be] text-white py-2 rounded-lg text-sm font-semibold transition-colors flex items-center justify-center gap-1.5 shadow-xs cursor-pointer"
            >
              <Search className="w-4 h-4" />
              <span>Search</span>
            </button>
            <button
              onClick={() => {
                setStatusFilter("All Status");
                setSearchQuery("");
                toast.info("Filters reset");
              }}
              className="border border-[#E2E8F0] hover:bg-slate-50 text-[#64748B] p-2 rounded-lg text-sm font-medium transition-colors flex items-center justify-center cursor-pointer"
              title="Reset"
            >
              <RotateCcw className="w-4 h-4" />
            </button>
          </div>
        </div>
      </div>

      {/* 5. Certificate Table */}
      <div className="bg-white rounded-xl border border-[#E5EAF0] shadow-xs overflow-hidden">
        <div className="p-4 border-b border-[#E5EAF0] flex items-center justify-between">
          <div className="flex items-center gap-2">
            <FileCheck2 className="w-5 h-5 text-[#1769E8]" />
            <h2 className="font-heading font-bold text-lg text-[#071A4D]">
              Medical Certificate Ledger ({filteredCerts.length})
            </h2>
          </div>
          <span className="text-xs text-[#64748B]">
            Compliant with NCHMCT Health Examination Norms
          </span>
        </div>

        <div className="overflow-x-auto">
          <table className="w-full text-left text-xs border-collapse">
            <thead>
              <tr className="bg-[#F8FAFC] border-b border-[#E5EAF0] text-[#64748B] font-semibold">
                <th className="py-3 px-3.5 w-8 text-center">#</th>
                <th className="py-3 px-3.5 font-bold text-[#071A4D]">Certificate Reference</th>
                <th className="py-3 px-3.5 font-bold text-[#071A4D]">Student Roll & Name</th>
                <th className="py-3 px-3.5 font-bold text-[#071A4D]">Hospital / Clinic</th>
                <th className="py-3 px-3.5 font-bold text-[#071A4D]">Attending Doctor</th>
                <th className="py-3 px-3.5 font-bold text-[#071A4D] text-center">Rest Days</th>
                <th className="py-3 px-3.5 font-bold text-[#071A4D] text-center">Submission Timing</th>
                <th className="py-3 px-3.5 font-bold text-[#071A4D] text-center">CMO Status</th>
                <th className="py-3 px-4 font-bold text-[#071A4D] text-right">Actions</th>
              </tr>
            </thead>
            <tbody className="divide-y divide-[#E5EAF0]">
              {filteredCerts.length === 0 ? (
                <tr>
                  <td colSpan={9} className="py-12 text-center text-slate-400">
                    No certificate records match your filter criteria.
                  </td>
                </tr>
              ) : (
                filteredCerts.map((c, idx) => (
                  <tr key={c.id} className="hover:bg-[#F8FAFC] transition-colors">
                    <td className="py-3.5 px-3.5 text-center text-[#94A3B8] font-medium">
                      {idx + 1}
                    </td>
                    <td className="py-3.5 px-3.5">
                      <div className="font-mono font-bold text-xs text-[#1769E8] flex items-center gap-1.5">
                        <FileText className="w-3.5 h-3.5 text-[#1769E8]" />
                        <span>{c.certNumber}</span>
                      </div>
                      <div className="text-[11px] text-[#64748B]">
                        Issued: {c.issueDate}
                      </div>
                    </td>
                    <td className="py-3.5 px-3.5">
                      <div className="font-bold text-[#071A4D] text-sm">{c.studentName}</div>
                      <div className="font-mono text-[11px] text-[#64748B]">{c.rollNumber} • {c.batch}</div>
                    </td>
                    <td className="py-3.5 px-3.5">
                      <div className="font-medium text-[#071A4D] flex items-center gap-1">
                        <Hospital className="w-3.5 h-3.5 text-[#64748B]" />
                        <span className="truncate max-w-[200px]" title={c.hospitalName}>
                          {c.hospitalName}
                        </span>
                      </div>
                      <div className="text-[11px] text-[#64748B] italic truncate max-w-[200px]">
                        {c.diagnosis}
                      </div>
                    </td>
                    <td className="py-3.5 px-3.5">
                      <div className="font-semibold text-[#071A4D]">{c.doctorName}</div>
                      <div className="font-mono text-[10px] text-[#1769E8] bg-blue-50 px-1.5 py-0.5 rounded border border-blue-200 inline-block mt-0.5">
                        Reg: {c.doctorRegNo}
                      </div>
                    </td>
                    <td className="py-3.5 px-3.5 text-center font-bold text-[#071A4D] font-mono text-sm">
                      {c.restDays} Days
                    </td>
                    <td className="py-3.5 px-3.5 text-center">
                      {c.daysLate === 0 ? (
                        <span className="inline-flex items-center gap-1 text-[11px] font-bold text-emerald-700 bg-emerald-50 px-2 py-0.5 rounded-full border border-emerald-200">
                          <CheckCircle2 className="w-3 h-3" />
                          On Time
                        </span>
                      ) : (
                        <span className="inline-flex items-center gap-1 text-[11px] font-bold text-rose-700 bg-rose-50 px-2 py-0.5 rounded-full border border-rose-200">
                          <AlertTriangle className="w-3 h-3" />
                          +{c.daysLate}d Late
                        </span>
                      )}
                    </td>
                    <td className="py-3.5 px-3.5 text-center">
                      <span
                        className={`inline-flex items-center px-2.5 py-0.5 rounded-full text-[11px] font-bold border ${
                          c.status === "Verified"
                            ? "bg-emerald-50 text-emerald-700 border-emerald-200"
                            : c.status === "Pending"
                            ? "bg-amber-50 text-amber-700 border-amber-200"
                            : "bg-rose-50 text-rose-700 border-rose-200"
                        }`}
                      >
                        {c.status}
                      </span>
                    </td>
                    <td className="py-3.5 px-4 text-right">
                      <div className="flex items-center justify-end gap-1.5">
                        <button
                          onClick={() => setSelectedCert(c)}
                          className="px-2.5 py-1 bg-[#1769E8] hover:bg-[#1255be] text-white rounded text-[11px] font-semibold transition-colors flex items-center gap-1 cursor-pointer"
                        >
                          <Eye className="w-3 h-3" />
                          <span>Inspect</span>
                        </button>
                      </div>
                    </td>
                  </tr>
                ))
              )}
            </tbody>
          </table>
        </div>
      </div>

      {/* 6. Document Inspector Modal */}
      {selectedCert && (
        <div className="fixed inset-0 bg-black/60 z-50 flex items-center justify-center p-4">
          <div className="bg-white rounded-2xl max-w-2xl w-full shadow-2xl border border-slate-200 overflow-hidden animate-in fade-in zoom-in-95 duration-200">
            <div className="bg-[#081A2E] text-white p-5 flex items-center justify-between">
              <div className="flex items-center gap-2.5">
                <FileCheck2 className="w-5 h-5 text-[#F4B400]" />
                <div>
                  <h3 className="font-heading font-bold text-base">
                    Medical Certificate Inspection
                  </h3>
                  <p className="text-xs text-slate-300 font-mono">
                    {selectedCert.certNumber}
                  </p>
                </div>
              </div>
              <button
                onClick={() => setSelectedCert(null)}
                className="text-slate-300 hover:text-white p-1 rounded-md text-lg cursor-pointer"
              >
                ✕
              </button>
            </div>

            <div className="p-6 space-y-5 text-xs text-[#334155]">
              {/* Simulated Certificate Sheet */}
              <div className="p-5 bg-slate-50 border-2 border-dashed border-slate-300 rounded-xl space-y-3 font-serif">
                <div className="text-center border-b border-slate-300 pb-3">
                  <h4 className="font-bold text-sm tracking-wide text-[#071A4D] font-sans">
                    {selectedCert.hospitalName.toUpperCase()}
                  </h4>
                  <p className="text-[11px] text-[#64748B] font-sans">
                    Department of Clinical Medicine & Outpatient Services
                  </p>
                </div>

                <div className="text-right text-[11px] text-[#64748B] font-mono">
                  Date: {selectedCert.issueDate}
                </div>

                <div className="text-sm font-sans leading-relaxed text-[#0F172A]">
                  This is to certify that <strong>{selectedCert.studentName}</strong> (Roll No:{" "}
                  <span className="font-mono text-[#1769E8] font-bold">{selectedCert.rollNumber}</span>) was under my medical care. The student was diagnosed with{" "}
                  <em>{selectedCert.diagnosis}</em> and was advised strict medical rest for{" "}
                  <strong>{selectedCert.restDays} calendar days</strong> starting from{" "}
                  {selectedCert.issueDate}.
                </div>

                <div className="pt-4 flex items-end justify-between border-t border-slate-300">
                  <div className="space-y-1 font-sans text-[11px]">
                    <div className="text-[#64748B]">Medical Council ID:</div>
                    <div className="font-mono font-bold text-[#071A4D]">{selectedCert.doctorRegNo}</div>
                  </div>
                  <div className="text-right font-sans">
                    <div className="w-32 h-10 border border-slate-300 bg-white rounded flex items-center justify-center text-[10px] text-slate-400 font-mono mb-1">
                      [ CLINIC SEAL ]
                    </div>
                    <div className="font-bold text-[#071A4D]">{selectedCert.doctorName}</div>
                    <div className="text-[10px] text-[#64748B]">Attending Physician</div>
                  </div>
                </div>
              </div>

              {/* CMO Action Box */}
              <div className="bg-[#EFF6FF] border border-[#BFDBFE] p-4 rounded-xl flex items-center justify-between">
                <div>
                  <div className="font-bold text-[#071A4D] text-sm">
                    Chief Medical Officer (CMO) Verification
                  </div>
                  <div className="text-[11px] text-[#475569]">
                    Current Status: <span className="font-bold text-[#1769E8]">{selectedCert.status}</span>
                  </div>
                </div>

                <div className="flex items-center gap-2">
                  <button
                    onClick={() => handleReject(selectedCert.id)}
                    className="px-3 py-1.5 bg-white border border-rose-200 text-rose-700 hover:bg-rose-50 rounded-lg font-semibold text-xs transition-colors cursor-pointer"
                  >
                    Reject Certificate
                  </button>
                  <button
                    onClick={() => handleVerify(selectedCert.id)}
                    className="px-4 py-1.5 bg-emerald-600 hover:bg-emerald-700 text-white rounded-lg font-semibold text-xs transition-colors flex items-center gap-1.5 shadow-xs cursor-pointer"
                  >
                    <CheckCircle2 className="w-3.5 h-3.5" />
                    <span>Endorse & Verify</span>
                  </button>
                </div>
              </div>
            </div>

            <div className="bg-slate-50 px-6 py-3 border-t border-slate-200 flex justify-end">
              <button
                onClick={() => setSelectedCert(null)}
                className="px-4 py-1.5 bg-white border border-slate-300 rounded-lg text-xs font-semibold text-slate-700 hover:bg-slate-100 transition-colors cursor-pointer"
              >
                Close Inspector
              </button>
            </div>
          </div>
        </div>
      )}
    </div>
  );
}
