import { useState } from "react";
import { useApp } from "../AppContext";
import { BackHeader } from "../components/ui";
import DeleteAccountConfirmBody from "../components/DeleteAccountConfirmBody";

/**
 * Frame B — full page "حذف الحساب" confirmation.
 * `variant="checked"` renders the second version with the checkbox ticked
 * and the destructive red button active.
 */
export default function ProfileDeleteConfirm({
  variant = "unchecked",
}: {
  variant?: "unchecked" | "checked";
}) {
  const { navigate, goBack } = useApp();
  const [checked, setChecked] = useState(variant === "checked");

  return (
    <div className="min-h-full flex flex-col bg-background-50">
      <BackHeader title="حذف الحساب" onBack={goBack} />
      <DeleteAccountConfirmBody
        checked={checked}
        onToggle={() => setChecked((v) => !v)}
        onConfirm={() => navigate("profileDeleteFinal")}
        onCancel={() => navigate("profile")}
      />
    </div>
  );
}