Add date editing with conflict detection and rental booking editing

- BookingDetailPanel: edit dates/room with inline conflict detection; options to force-save or swap conflicting booking's room
- BookingsPage + CalendarPage: pass rooms/allBookings/onBulkUpdate to panel
- RentalBookingModal: accept editBooking prop to pre-populate fields for editing
- RentalPage: add edit (pencil) button per booking row, unify create/update handler

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-16 15:13:49 +03:00
parent 84c90bcab1
commit 913ddeedc9
6 changed files with 224 additions and 38 deletions

View File

@@ -363,11 +363,21 @@ export function BookingsPage() {
<BookingDetailPanel
booking={selected}
room={room(selected.roomId)}
rooms={MOCK_ROOMS}
allBookings={bookings}
onClose={() => setSelected(null)}
onUpdate={(id, data) => {
setBookings(prev => prev.map(b => b.id === id ? { ...b, ...data } : b))
setSelected(null)
}}
onBulkUpdate={(updates) => {
setBookings(prev => {
let next = [...prev]
updates.forEach(u => { next = next.map(b => b.id === u.id ? { ...b, ...u.data } : b) })
return next
})
setSelected(null)
}}
/>
)}