"use client"; // Components/Car/CarDeleteModal.tsx // Confirmation dialog before soft-deleting a car. import { useEffect } from "react"; import { Spinner } from "../UI"; import type { Car } from "../../types/car"; interface CarDeleteModalProps { car: Car; deleting: boolean; onCancel: () => void; onConfirm: () => void; } export function CarDeleteModal({ car, deleting, onCancel, onConfirm }: CarDeleteModalProps) { useEffect(() => { const h = (e: KeyboardEvent) => { if (e.key === "Escape") onCancel(); }; window.addEventListener("keydown", h); return () => window.removeEventListener("keydown", h); }, [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: 420, 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", }} > {/* Icon */}

حذف المركبة

هل أنت متأكد من حذف{" "} {car.manufacturer} {car.model} {" "}( {car.plateLetters} {car.plateNumber} )؟ لا يمكن التراجع عن هذا الإجراء.

); }