feat: 3 improvements — hourly toggle position, category rooms panel, period prices in grid

1. BookingModal: move Посуточно/Почасово toggle to top (before dates)
   when room has hourly rate enabled
2. RoomCategoriesPage: Номера > button now expands inline panel
   showing rooms belonging to that category
3. AvailabilityPage:
   - Period prices auto-applied to grid (base → periods → overrides),
     cells from periods show violet П badge
   - П legend item added
   - Hourly rate settings shown in Periods tab for hourly-enabled rooms

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-24 20:32:32 +03:00
parent 2b21f2c219
commit b3d143f1dd
4 changed files with 184 additions and 47 deletions

View File

@@ -753,6 +753,36 @@ export function BookingModal({ open, draft, rooms, bookings = [], onClose, onSav
{/* ── LEFT COLUMN ── */}
<div className="flex-1 space-y-4 min-w-0">
{/* Почасово / посуточно — только если у выбранного номера есть почасовая ставка */}
{showHourlyTab && (
<div className="flex rounded-lg overflow-hidden border border-slate-200 dark:border-slate-600">
<button
type="button"
onClick={() => setIsHourly(false)}
className={cn(
'flex-1 py-1.5 text-sm font-medium transition-colors',
!isHourly
? 'bg-brand-600 text-white'
: 'bg-white dark:bg-slate-700 text-slate-600 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600',
)}
>
Посуточно
</button>
<button
type="button"
onClick={() => setIsHourly(true)}
className={cn(
'flex-1 py-1.5 text-sm font-medium transition-colors',
isHourly
? 'bg-brand-600 text-white'
: 'bg-white dark:bg-slate-700 text-slate-600 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600',
)}
>
Почасово
</button>
</div>
)}
{/* 1. Даты заезда / выезда */}
<div>
<label className="block text-sm font-semibold text-slate-700 dark:text-slate-300 mb-2">
@@ -915,35 +945,6 @@ export function BookingModal({ open, draft, rooms, bookings = [], onClose, onSav
</div>
)}
{/* Почасово / посуточно — только если у выбранного номера есть почасовая ставка */}
{showHourlyTab && (
<div className="mt-3 flex rounded-lg overflow-hidden border border-slate-200 dark:border-slate-600">
<button
type="button"
onClick={() => setIsHourly(false)}
className={cn(
'flex-1 py-1.5 text-sm font-medium transition-colors',
!isHourly
? 'bg-brand-600 text-white'
: 'bg-white dark:bg-slate-700 text-slate-600 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600',
)}
>
Посуточно
</button>
<button
type="button"
onClick={() => setIsHourly(true)}
className={cn(
'flex-1 py-1.5 text-sm font-medium transition-colors',
isHourly
? 'bg-brand-600 text-white'
: 'bg-white dark:bg-slate-700 text-slate-600 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600',
)}
>
Почасово
</button>
</div>
)}
</div>
</div>