"use client"; import { useEffect } from "react"; import { Spinner } from "../UI"; import type { Client } from "../../types/client"; interface DeleteConfirmModalProps { client: Client; deleting: boolean; onCancel: () => void; onConfirm: () => void; } export function DeleteConfirmModal({ client, deleting, onCancel, onConfirm, }: DeleteConfirmModalProps) { // Close on Escape — identical to User/DeleteConfirmModal useEffect(() => { const handler = (e: KeyboardEvent) => { if (e.key === "Escape") onCancel(); }; window.addEventListener("keydown", handler); return () => window.removeEventListener("keydown", handler); }, [onCancel]); return (
{ if (e.target === e.currentTarget) onCancel(); }} style={{ position: "fixed", inset: 0, zIndex: 60, background: "rgba(15,23,42,0.55)", backdropFilter: "blur(4px)", display: "flex", alignItems: "center", justifyContent: "center", padding: "1rem", }} >
e.stopPropagation()} style={{ width: "100%", maxWidth: 400, background: "var(--color-surface)", borderRadius: "var(--radius-xl)", border: "1px solid #FECACA", boxShadow: "0 20px 48px rgba(0,0,0,.18)", padding: "2rem", display: "flex", flexDirection: "column", gap: "1rem", textAlign: "center", }} > {/* أيقونة الحذف */}

حذف العميل

هل أنت متأكد من حذف{" "} {client.name} ؟ سيتم حذف جميع عناوينه أيضاً. لا يمكن التراجع عن هذا الإجراء.

); }