import { useRef } from "preact/hooks"; import { useFocusTrap } from "../utils/useFocusTrap.ts"; export type ConfirmAction = "approve" | "reject"; interface LeaseApprovalConfirmDialogProps { open: boolean; action: ConfirmAction; leaseId: string; onConfirm: () => void; onCancel: () => void; } const MESSAGES: Record = { approve: "Are you sure you want to approve this lease? This will make the lease active and the tenant will be able to access the property.", reject: "Are you sure you want to reject this lease request?", }; const CONFIRM_LABELS: Record = { approve: "Approve", reject: "Reject", }; export default function LeaseApprovalConfirmDialog({ open, action, onConfirm, onCancel, }: LeaseApprovalConfirmDialogProps) { const modalRef = useRef(null); useFocusTrap(open, modalRef); if (!open) return null; return ( ); }