"use client";

import { useEffect, useMemo, useState } from "react";
import { apiGet, apiPost } from "@/lib/api";

type DryRunStatus = "Ready" | "Check" | "Blocked" | "Locked";
type DryRunRowStatus = "Dry-run ready" | "Needs v458 packet" | "Already controlled" | "Rollback blocked" | "Guardrail blocked" | "Out of dry run" | "Locked";

type DryRunCheckRow = {
  key: string;
  label: string;
  status: DryRunStatus;
  detail: string;
  firstFix: string;
  dryRunEffect: string;
};

type DryRunBoundaryItem = {
  key: string;
  boundary: string;
  status: DryRunStatus;
  owner: string;
  instruction: string;
  evidenceNeeded: string;
};

type DryRunRow = {
  workspaceId: string;
  subscriptionId: string;
  workspaceName: string;
  workspaceSlug: string;
  workspaceTypeLabel: string;
  accountClassLabel: string;
  subscriptionStatus: string;
  planName: string;
  planStatus: string;
  providerSyncStatus: string;
  activationStatus: string;
  rolloutScopeStatus: string;
  supportOutcomeStatus: string;
  closeoutStatus: string;
  safetyStatus: string;
  includedInActivationPacket: boolean;
  configuredInDryRunScope: boolean;
  includedInDryRun: boolean;
  alreadyInControlledScope: boolean;
  controlledPilotCurrentlyActive: boolean;
  wouldExpandControlledScope: boolean;
  dryRunStatus: DryRunRowStatus;
  simulatedOutcome: string;
  currentPolicyMode: string;
  currentPolicyEffect: string;
  firstFix: string;
  dryRunInstruction: string;
};

type EvidenceEvent = {
  id: string;
  action: string;
  recordedAt: string | null;
  recordedBy: string;
  summary: string;
  note: string;
  dryRunStatus: string;
  dryRunBoundaryStatus: string;
  dryRunLabel: string;
  dryRunCandidateCount: number;
  dryRunReadyCount: number;
  wouldExpandCount: number;
  blockedDryRunCount: number;
};

type Review = {
  summary: {
    overallStatus: DryRunStatus;
    dryRunLabel: string;
    totalReviewedWorkspaces: number;
    dryRunCandidateCount: number;
    dryRunReadyCount: number;
    needsV458PacketCount: number;
    rollbackBlockedCount: number;
    guardrailBlockedCount: number;
    lockedDryRunCount: number;
    blockedDryRunCount: number;
    outOfDryRunCount: number;
    wouldExpandCount: number;
    alreadyControlledCount: number;
    currentControlledIdentifierCount: number;
    maxDryRunWorkspaces: number;
    configuredDryRunScopeCount: number;
    activationReadinessReviewCount: number;
    activationPacketRecordCount: number;
    dryRunReviewCount: number;
    dryRunBoundaryRecordCount: number;
    evidenceChainCount: number;
    canRecordDryRunReview: boolean;
    canRecordDryRunBoundary: boolean;
    dryRunExportRequired: boolean;
    readyForLaterRuntimeExpansionBuild: boolean;
    firstFix: string;
  };
  environment: {
    dryRunEnabled: boolean;
    recordingEnabled: boolean;
    exportRequired: boolean;
    requirePacketRecord: boolean;
    runtimeMutationBlocked: boolean;
    dryRunLabel: string;
    configuredDryRunIdentifiers: string[];
    maxDryRunWorkspaces: number;
    currentPolicyIdentifiers: string[];
    controlledActivationEnabled: boolean;
    controlledActivationReviewOnly: boolean;
    rollbackActive: boolean;
    broadHardBillingGatesEnabled: boolean;
    paymentCollectionEnabled: boolean;
    billingStatusMutationEnabled: boolean;
    customerPortalEnabled: boolean;
    brokerDistributionChanged: boolean;
    ownedPortalRulesChanged: boolean;
    internalLoadBoardAccessChanged: boolean;
  };
  checks: DryRunCheckRow[];
  dryRunBoundary: DryRunBoundaryItem[];
  dryRunRows: DryRunRow[];
  recentEvents: EvidenceEvent[];
};

function statusClasses(status: DryRunStatus | DryRunRowStatus | string) {
  if (status === "Ready" || status === "Dry-run ready" || status === "Already controlled") return "bg-emerald-100 text-emerald-700";
  if (status === "Blocked" || status === "Rollback blocked" || status === "Guardrail blocked") return "bg-rose-100 text-rose-700";
  if (status === "Locked" || status === "Out of dry run") return "bg-blue-100 text-blue-700";
  return "bg-amber-100 text-amber-700";
}

function dateTime(value?: string | null) {
  if (!value) return "Not recorded";
  return new Date(value).toLocaleString();
}

function csvEscape(value: unknown) {
  const text = String(value ?? "");
  if (/[",\n]/.test(text)) return `"${text.replace(/"/g, '""')}"`;
  return text;
}

function downloadCsv(filename: string, headers: string[], rows: unknown[][]) {
  const csv = [headers, ...rows].map((row) => row.map(csvEscape).join(",")).join("\n");
  const blob = new Blob([csv], { type: "text/csv;charset=utf-8" });
  const url = URL.createObjectURL(blob);
  const link = document.createElement("a");
  link.href = url;
  link.download = filename;
  document.body.appendChild(link);
  link.click();
  link.remove();
  URL.revokeObjectURL(url);
}

function rowText(row: DryRunRow) {
  return [
    row.workspaceName,
    row.workspaceSlug,
    row.workspaceTypeLabel,
    row.accountClassLabel,
    row.subscriptionStatus,
    row.planName,
    row.planStatus,
    row.providerSyncStatus,
    row.activationStatus,
    row.rolloutScopeStatus,
    row.supportOutcomeStatus,
    row.dryRunStatus,
    row.simulatedOutcome,
    row.currentPolicyMode,
    row.firstFix,
  ].join(" ").toLowerCase();
}

export function AdminHardBillingGateExpansionDryRunActivationPanel() {
  const [review, setReview] = useState<Review | null>(null);
  const [loaded, setLoaded] = useState(false);
  const [error, setError] = useState<string | null>(null);
  const [filter, setFilter] = useState("dry-run");
  const [search, setSearch] = useState("");
  const [note, setNote] = useState("");
  const [saving, setSaving] = useState<"review" | "boundary" | null>(null);

  async function loadReview() {
    const data = await apiGet<Review>("/api/admin/hard-billing-gates/expansion-dry-run-activation");
    setReview(data);
  }

  useEffect(() => {
    let cancelled = false;
    async function load() {
      try {
        setError(null);
        const data = await apiGet<Review>("/api/admin/hard-billing-gates/expansion-dry-run-activation");
        if (!cancelled) setReview(data);
      } catch (err: any) {
        if (!cancelled) setError(err?.message ?? "Failed to load hard billing gate expansion dry-run activation boundary.");
      } finally {
        if (!cancelled) setLoaded(true);
      }
    }
    void load();
    return () => {
      cancelled = true;
    };
  }, []);

  const needle = search.trim().toLowerCase();
  const rows = useMemo(() => {
    return (review?.dryRunRows ?? []).filter((row) => {
      const matchesFilter = filter === "all"
        || row.dryRunStatus === filter
        || row.activationStatus === filter
        || row.rolloutScopeStatus === filter
        || row.supportOutcomeStatus === filter
        || (filter === "dry-run" && row.includedInDryRun)
        || (filter === "configured" && row.configuredInDryRunScope)
        || (filter === "ready" && ["Dry-run ready", "Already controlled"].includes(row.dryRunStatus))
        || (filter === "would-expand" && row.wouldExpandControlledScope)
        || (filter === "already-controlled" && (row.alreadyInControlledScope || row.controlledPilotCurrentlyActive))
        || (filter === "blocked" && ["Needs v458 packet", "Rollback blocked", "Guardrail blocked", "Locked"].includes(row.dryRunStatus));
      const matchesSearch = !needle || rowText(row).includes(needle);
      return matchesFilter && matchesSearch;
    });
  }, [review, filter, needle]);

  async function recordEvidence(recordType: "review" | "boundary") {
    try {
      setSaving(recordType);
      setError(null);
      const data = await apiPost<Review>("/api/admin/hard-billing-gates/expansion-dry-run-activation", { note, recordType });
      setReview(data);
      setNote("");
    } catch (err: any) {
      setError(err?.message ?? "Failed to record hard billing gate expansion dry-run activation evidence.");
      await loadReview().catch(() => undefined);
    } finally {
      setSaving(null);
    }
  }

  function exportDryRunRows() {
    downloadCsv(
      "dispatchspot-hard-billing-gate-expansion-dry-run-rows.csv",
      ["Workspace", "Slug", "Workspace type", "Account class", "Included", "Configured", "Dry-run status", "Would expand", "Already controlled", "Current policy mode", "Simulated outcome", "Activation packet", "Rollout scope", "Support outcome", "Closeout", "Safety", "Subscription", "Plan", "Plan status", "Provider sync", "First fix", "Instruction"],
      (review?.dryRunRows ?? []).map((row) => [
        row.workspaceName,
        row.workspaceSlug,
        row.workspaceTypeLabel,
        row.accountClassLabel,
        row.includedInDryRun ? "Yes" : "No",
        row.configuredInDryRunScope ? "Yes" : "No",
        row.dryRunStatus,
        row.wouldExpandControlledScope ? "Yes" : "No",
        row.alreadyInControlledScope || row.controlledPilotCurrentlyActive ? "Yes" : "No",
        row.currentPolicyMode,
        row.simulatedOutcome,
        row.activationStatus,
        row.rolloutScopeStatus,
        row.supportOutcomeStatus,
        row.closeoutStatus,
        row.safetyStatus,
        row.subscriptionStatus,
        row.planName,
        row.planStatus,
        row.providerSyncStatus,
        row.firstFix,
        row.dryRunInstruction,
      ]),
    );
  }

  function exportDryRunBoundary() {
    downloadCsv(
      "dispatchspot-hard-billing-gate-expansion-dry-run-boundary.csv",
      ["Boundary", "Status", "Owner", "Instruction", "Evidence needed"],
      (review?.dryRunBoundary ?? []).map((item) => [item.boundary, item.status, item.owner, item.instruction, item.evidenceNeeded]),
    );
  }

  function exportHistory() {
    downloadCsv(
      "dispatchspot-hard-billing-gate-expansion-dry-run-history.csv",
      ["Recorded at", "Recorded by", "Action", "Dry-run status", "Boundary status", "Dry-run label", "Candidates", "Ready", "Would expand", "Blocked", "Summary", "Note"],
      (review?.recentEvents ?? []).map((event) => [
        dateTime(event.recordedAt),
        event.recordedBy,
        event.action,
        event.dryRunStatus,
        event.dryRunBoundaryStatus,
        event.dryRunLabel,
        event.dryRunCandidateCount,
        event.dryRunReadyCount,
        event.wouldExpandCount,
        event.blockedDryRunCount,
        event.summary,
        event.note,
      ]),
    );
  }

  if (!loaded) {
    return <section className="rounded-3xl border border-slate-200 bg-white p-6 shadow-sm"><p className="text-sm text-slate-500">Loading hard billing gate expansion dry-run activation boundary…</p></section>;
  }

  if (!review) {
    return <section className="rounded-3xl border border-rose-200 bg-rose-50 p-6"><p className="text-sm text-rose-700">{error ?? "Hard billing gate expansion dry-run activation boundary is unavailable."}</p></section>;
  }

  const summary = review.summary;
  const env = review.environment;

  return (
    <section className="space-y-5 rounded-3xl border border-slate-200 bg-white p-6 shadow-sm">
      <div className="flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between">
        <div>
          <p className="text-xs font-semibold uppercase tracking-wide text-slate-500">v459 controlled expansion dry run</p>
          <h2 className="mt-1 text-xl font-semibold text-slate-950">Controlled hard-gate expansion dry-run activation boundary</h2>
          <p className="mt-2 max-w-3xl text-sm text-slate-600">
            Super Admin can preview which v458 activation-packet workspaces would enter controlled hard-gate scope in a later activation build. This is a dry run only; it does not collect payment, mutate billing status, change runtime hard-gate scope, change broker distribution, change owned portal rules, or open internal load-board access.
          </p>
        </div>
        <span className={`rounded-full px-3 py-1 text-xs font-semibold ${statusClasses(summary.overallStatus)}`}>{summary.overallStatus}</span>
      </div>

      {error ? <div className="rounded-2xl border border-rose-200 bg-rose-50 p-3 text-sm text-rose-700">{error}</div> : null}

      <div className="grid gap-3 md:grid-cols-2 xl:grid-cols-5">
        <div className="rounded-2xl border border-slate-200 bg-slate-50 p-4">
          <p className="text-xs uppercase tracking-wide text-slate-500">Dry-run label</p>
          <p className="mt-1 text-lg font-semibold text-slate-950">{summary.dryRunLabel}</p>
        </div>
        <div className="rounded-2xl border border-slate-200 bg-slate-50 p-4">
          <p className="text-xs uppercase tracking-wide text-slate-500">Dry-run candidates</p>
          <p className="mt-1 text-lg font-semibold text-slate-950">{summary.dryRunCandidateCount}</p>
          <p className="text-xs text-slate-500">Max {summary.maxDryRunWorkspaces}</p>
        </div>
        <div className="rounded-2xl border border-slate-200 bg-slate-50 p-4">
          <p className="text-xs uppercase tracking-wide text-slate-500">Ready</p>
          <p className="mt-1 text-lg font-semibold text-slate-950">{summary.dryRunReadyCount}</p>
          <p className="text-xs text-slate-500">{summary.wouldExpandCount} would expand</p>
        </div>
        <div className="rounded-2xl border border-slate-200 bg-slate-50 p-4">
          <p className="text-xs uppercase tracking-wide text-slate-500">Blocked / locked</p>
          <p className="mt-1 text-lg font-semibold text-slate-950">{summary.blockedDryRunCount}</p>
          <p className="text-xs text-slate-500">{summary.alreadyControlledCount} already controlled</p>
        </div>
        <div className="rounded-2xl border border-slate-200 bg-slate-50 p-4">
          <p className="text-xs uppercase tracking-wide text-slate-500">Evidence chain</p>
          <p className="mt-1 text-lg font-semibold text-slate-950">{summary.evidenceChainCount}</p>
          <p className="text-xs text-slate-500">{summary.currentControlledIdentifierCount} current IDs</p>
        </div>
      </div>

      <div className="rounded-2xl border border-amber-200 bg-amber-50 p-4 text-sm text-amber-800">
        <p className="font-semibold">First fix: {summary.firstFix}</p>
        <p className="mt-1 text-xs">
          Dry-run review {env.dryRunEnabled ? "on" : "locked"}. Recording {env.recordingEnabled ? "on" : "locked"}. Runtime mutation lock {env.runtimeMutationBlocked ? "on" : "off"}. Controlled activation {env.controlledActivationEnabled ? "on" : "off"}; review-only {env.controlledActivationReviewOnly ? "on" : "off"}; rollback stop {env.rollbackActive ? "on" : "off"}. Broad hard gates {env.broadHardBillingGatesEnabled ? "on" : "off"}; payment collection {env.paymentCollectionEnabled ? "on" : "off"}; billing status mutation {env.billingStatusMutationEnabled ? "on" : "off"}; customer portal {env.customerPortalEnabled ? "on" : "off"}.
        </p>
      </div>

      <div className="grid gap-3 md:grid-cols-2 xl:grid-cols-4">
        {review.checks.map((item) => (
          <div key={item.key} className="rounded-2xl border border-slate-200 p-4">
            <div className="flex items-center justify-between gap-2">
              <p className="text-sm font-semibold text-slate-900">{item.label}</p>
              <span className={`rounded-full px-2 py-1 text-[11px] font-semibold ${statusClasses(item.status)}`}>{item.status}</span>
            </div>
            <p className="mt-2 text-xs text-slate-600">{item.detail}</p>
            <p className="mt-2 text-xs font-medium text-slate-700">{item.firstFix}</p>
            <p className="mt-2 text-[11px] text-slate-500">{item.dryRunEffect}</p>
          </div>
        ))}
      </div>

      <div className="rounded-2xl border border-slate-200 bg-slate-50 p-4">
        <div className="flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between">
          <div>
            <h3 className="text-sm font-semibold text-slate-950">Dry-run activation boundary</h3>
            <p className="mt-1 text-xs text-slate-500">This boundary compares the proposed dry-run scope against current controlled hard-gate policy. It does not change the allowlist.</p>
          </div>
          <button className="rounded-xl border border-slate-300 bg-white px-3 py-2 text-xs font-semibold text-slate-700 hover:bg-slate-100" onClick={exportDryRunBoundary}>Export boundary checklist</button>
        </div>
        <div className="mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-3">
          {review.dryRunBoundary.map((item) => (
            <div key={item.key} className="rounded-xl border border-slate-200 bg-white p-4 text-xs text-slate-600">
              <div className="flex items-center justify-between gap-2">
                <p className="font-semibold text-slate-900">{item.boundary}</p>
                <span className={`rounded-full px-2 py-1 text-[11px] font-semibold ${statusClasses(item.status)}`}>{item.status}</span>
              </div>
              <p className="mt-1 text-slate-500">Owner: {item.owner}</p>
              <p className="mt-2">{item.instruction}</p>
              <p className="mt-2 font-medium text-slate-700">{item.evidenceNeeded}</p>
            </div>
          ))}
        </div>
      </div>

      <div className="flex flex-col gap-3 rounded-2xl border border-slate-200 bg-slate-50 p-4 lg:flex-row lg:items-center lg:justify-between">
        <div className="flex flex-wrap gap-2">
          <select className="rounded-xl border border-slate-300 bg-white px-3 py-2 text-sm" value={filter} onChange={(event) => setFilter(event.target.value)}>
            <option value="dry-run">Included in dry run</option>
            <option value="ready">Ready or already controlled</option>
            <option value="would-expand">Would expand controlled scope</option>
            <option value="already-controlled">Already controlled</option>
            <option value="blocked">Blocked or locked</option>
            <option value="configured">Configured dry-run scope</option>
            <option value="all">All reviewed rows</option>
            <option value="Dry-run ready">Dry-run ready status</option>
            <option value="Needs v458 packet">Needs v458 packet</option>
            <option value="Rollback blocked">Rollback blocked</option>
            <option value="Guardrail blocked">Guardrail blocked</option>
            <option value="Out of dry run">Out of dry run</option>
            <option value="Locked">Locked</option>
          </select>
          <input
            className="min-w-[260px] rounded-xl border border-slate-300 bg-white px-3 py-2 text-sm"
            placeholder="Search workspace, dry-run status, policy mode…"
            value={search}
            onChange={(event) => setSearch(event.target.value)}
          />
        </div>
        <div className="flex flex-wrap gap-2">
          <button className="rounded-xl border border-slate-300 bg-white px-3 py-2 text-xs font-semibold text-slate-700 hover:bg-slate-100" onClick={exportDryRunRows}>Export dry-run rows</button>
          <button className="rounded-xl border border-slate-300 bg-white px-3 py-2 text-xs font-semibold text-slate-700 hover:bg-slate-100" onClick={exportHistory}>Export evidence history</button>
        </div>
      </div>

      <div className="overflow-x-auto rounded-2xl border border-slate-200">
        <table className="min-w-full divide-y divide-slate-200 text-sm">
          <thead className="bg-slate-50 text-left text-xs font-semibold uppercase tracking-wide text-slate-500">
            <tr>
              <th className="px-4 py-3">Workspace</th>
              <th className="px-4 py-3">Dry-run result</th>
              <th className="px-4 py-3">Source evidence</th>
              <th className="px-4 py-3">Instruction</th>
            </tr>
          </thead>
          <tbody className="divide-y divide-slate-200 bg-white">
            {rows.map((row) => (
              <tr key={`${row.workspaceId}-${row.subscriptionId}`} className="align-top">
                <td className="px-4 py-3">
                  <p className="font-semibold text-slate-950">{row.workspaceName}</p>
                  <p className="text-xs text-slate-500">/{row.workspaceSlug}</p>
                  <p className="text-xs text-slate-500">{row.workspaceTypeLabel} · {row.accountClassLabel}</p>
                </td>
                <td className="px-4 py-3">
                  <span className={`rounded-full px-2 py-1 text-[11px] font-semibold ${statusClasses(row.dryRunStatus)}`}>{row.dryRunStatus}</span>
                  <p className="mt-2 text-xs text-slate-600">{row.simulatedOutcome}</p>
                  <p className="text-xs text-slate-500">Would expand: {row.wouldExpandControlledScope ? "yes" : "no"}</p>
                  <p className="text-xs text-slate-500">Current policy: {row.currentPolicyMode}</p>
                </td>
                <td className="px-4 py-3 text-xs text-slate-600">
                  <p>Activation packet: {row.activationStatus}</p>
                  <p>Rollout: {row.rolloutScopeStatus}</p>
                  <p>Support: {row.supportOutcomeStatus}</p>
                  <p>Closeout: {row.closeoutStatus}</p>
                  <p>Safety: {row.safetyStatus}</p>
                  <p>{row.subscriptionStatus} · {row.planName}</p>
                  <p>Provider sync: {row.providerSyncStatus}</p>
                </td>
                <td className="px-4 py-3 text-xs leading-5 text-slate-600">
                  <p className="font-medium text-slate-700">{row.dryRunInstruction}</p>
                  <p className="mt-2 text-slate-500">{row.firstFix}</p>
                  <p className="mt-2 text-slate-500">{row.currentPolicyEffect}</p>
                </td>
              </tr>
            ))}
            {!rows.length ? (
              <tr>
                <td className="px-4 py-6 text-center text-sm text-slate-500" colSpan={4}>No dry-run rows match this filter.</td>
              </tr>
            ) : null}
          </tbody>
        </table>
      </div>

      <div className="grid gap-4 lg:grid-cols-[1fr_2fr]">
        <div className="rounded-2xl border border-slate-200 bg-slate-50 p-4">
          <h3 className="text-sm font-semibold text-slate-950">Record dry-run activation evidence</h3>
          <p className="mt-1 text-xs text-slate-500">Recording evidence does not change environment flags, workspace subscriptions, customer portal behavior, or hard-gate runtime scope.</p>
          <textarea
            className="mt-3 min-h-[92px] w-full rounded-xl border border-slate-300 px-3 py-2 text-sm"
            placeholder="Optional dry-run review or boundary note"
            value={note}
            onChange={(event) => setNote(event.target.value)}
          />
          <div className="mt-3 flex flex-wrap gap-2">
            <button
              className="rounded-xl bg-slate-950 px-4 py-2 text-sm font-semibold text-white disabled:cursor-not-allowed disabled:bg-slate-300"
              disabled={Boolean(saving) || !summary.canRecordDryRunReview}
              onClick={() => recordEvidence("review")}
            >
              {saving === "review" ? "Recording…" : "Record dry-run review"}
            </button>
            <button
              className="rounded-xl border border-slate-300 bg-white px-4 py-2 text-sm font-semibold text-slate-700 hover:bg-slate-100 disabled:cursor-not-allowed disabled:border-slate-200 disabled:text-slate-400"
              disabled={Boolean(saving) || !summary.canRecordDryRunBoundary}
              onClick={() => recordEvidence("boundary")}
            >
              {saving === "boundary" ? "Recording…" : "Record dry-run boundary"}
            </button>
          </div>
          {!summary.canRecordDryRunReview || !summary.canRecordDryRunBoundary ? <p className="mt-2 text-xs text-slate-500">Dry-run review or recording is locked by environment flag.</p> : null}
        </div>
        <div className="rounded-2xl border border-slate-200 bg-slate-50 p-4">
          <h3 className="text-sm font-semibold text-slate-950">Recent dry-run activation evidence</h3>
          <div className="mt-3 grid gap-2 md:grid-cols-2">
            {(review.recentEvents ?? []).slice(0, 8).map((event) => (
              <div key={event.id} className="rounded-xl border border-slate-200 bg-white p-3 text-xs text-slate-600">
                <p className="font-semibold text-slate-900">{event.summary}</p>
                <p>{dateTime(event.recordedAt)} by {event.recordedBy}</p>
                <p>{event.action}</p>
                <p>Review: {event.dryRunStatus || "not set"} · Boundary: {event.dryRunBoundaryStatus || "not set"}</p>
                <p>Scope: {event.dryRunLabel || "not set"} · Candidates: {event.dryRunCandidateCount} · Ready: {event.dryRunReadyCount} · Would expand: {event.wouldExpandCount} · Blocked: {event.blockedDryRunCount}</p>
                {event.note ? <p className="mt-1 text-slate-700">{event.note}</p> : null}
              </div>
            ))}
            {!review.recentEvents.length ? <p className="text-xs text-slate-500">No dry-run activation evidence has been recorded yet.</p> : null}
          </div>
        </div>
      </div>
    </section>
  );
}
