import { X, Mail, Phone, Calendar, Users, CreditCard, Tag, Edit2, CheckCircle, XCircle } from 'lucide-react' import { cn, BOOKING_STATUS_BADGE, BOOKING_STATUS_LABELS, SOURCE_COLORS, SOURCE_LABELS, formatCurrency, nightsCount } from '../../lib/utils' import type { Booking, Room } from '../../types' import { Badge } from '../ui/Badge' interface BookingDetailPanelProps { booking: Booking room?: Room onClose: () => void onUpdate: (id: string, data: Partial) => void } export function BookingDetailPanel({ booking, room, onClose, onUpdate }: BookingDetailPanelProps) { const nights = nightsCount(booking.checkIn, booking.checkOut) const balance = booking.totalAmount - booking.paidAmount const setStatus = (status: typeof booking.status) => onUpdate(booking.id, { status }) return ( <> {/* Backdrop */}
{/* Panel */}
{/* Header */}

{booking.guestName}

{BOOKING_STATUS_LABELS[booking.status]} {SOURCE_LABELS[booking.source]}
{/* Body */}
{/* Room */} {room && (

Номер

№{room.number} — {room.type}

Этаж {room.floor} · {room.bedType} bed

)} {/* Dates */}

Заезд

{new Intl.DateTimeFormat('ru-RU', { day: 'numeric', month: 'long' }).format(new Date(booking.checkIn))}

Выезд

{new Intl.DateTimeFormat('ru-RU', { day: 'numeric', month: 'long' }).format(new Date(booking.checkOut))}

{nights} {nights === 1 ? 'ночь' : nights < 5 ? 'ночи' : 'ночей'}

{/* Guests */}

Гости

{booking.adults} взр.{booking.children > 0 ? ` · ${booking.children} дет.` : ''}

{/* Contact */}

Контакты

{booking.guestEmail || '—'}
{/* Payment */}

Оплата

Стоимость {formatCurrency(booking.totalAmount)}
Оплачено {formatCurrency(booking.paidAmount)}
{balance > 0 && (
Остаток {formatCurrency(balance)}
)}
{/* Notes */} {booking.notes && (

Примечания

{booking.notes}

)} {/* Channel ID */} {booking.channelBookingId && (

ID канала

{booking.channelBookingId}
)}
{/* Actions */}
{booking.status === 'confirmed' && ( )} {booking.status === 'checked_in' && ( )} {(booking.status === 'confirmed' || booking.status === 'inquiry') && ( )}

ID: {booking.id} · Создано: {booking.createdAt}

) }