'use client' import { useEffect, useState, useCallback } from 'react' import dayjs from 'dayjs' import Link from 'next/link' import { formatCurrency } from '@rentaldrivego/types' import { apiFetch } from '@/lib/api' import { Globe, CheckCircle, XCircle, Clock, ChevronRight, User, Car, CalendarDays, MessageSquare } from 'lucide-react' import { useDashboardI18n } from '@/components/I18nProvider' interface OnlineReservation { id: string status: 'DRAFT' | 'CONFIRMED' | 'CANCELLED' | 'ACTIVE' | 'COMPLETED' | 'NO_SHOW' source: string startDate: string endDate: string totalAmount: number totalDays: number dailyRate: number notes: string | null cancelReason: string | null createdAt: string vehicle: { make: string; model: string; year: number; licensePlate: string } customer: { firstName: string; lastName: string; email: string; phone: string | null } } const STATUS_STYLE: Record = { DRAFT: 'bg-orange-100 text-orange-800', CONFIRMED: 'bg-emerald-100 text-emerald-700', CANCELLED: 'bg-rose-100 text-rose-700', ACTIVE: 'bg-blue-100 text-blue-700', COMPLETED: 'bg-slate-100 text-slate-600', NO_SHOW: 'bg-orange-100 text-orange-700', } const STATUS_LABEL: Record = { DRAFT: 'Pending', CONFIRMED: 'Confirmed', CANCELLED: 'Declined', ACTIVE: 'Active', COMPLETED: 'Completed', NO_SHOW: 'No show', } function DeclineModal({ onConfirm, onCancel, loading }: { onConfirm: (reason: string) => void; onCancel: () => void; loading: boolean }) { const [reason, setReason] = useState('') return (
e.stopPropagation()}>

Decline reservation

Optionally provide a reason — it will be visible in the reservation record.