"use client"; import { useEffect } from "react"; import { Spinner } from "../UI"; import type { Trip } from "../../types/trip"; interface TripDeleteModalProps { trip: Trip; deleting: boolean; onCancel: () => void; onConfirm: () => void; } export function TripDeleteModal({ trip, deleting, onCancel, onConfirm }: TripDeleteModalProps) { 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 */}

حذف الرحلة

هل أنت متأكد من حذف رحلة{" "} {trip.title} {" "}( {trip.tripNumber} )؟ لا يمكن التراجع عن هذا الإجراء.

); }