@@ -282,34 +383,64 @@
{#if ui.selectedDayKey}
{@const daySlots = itemSlotsByDay.get(ui.selectedDayKey) ?? []}
-
Available times
+
+ Available times · {formatDateKey(ui.selectedDayKey, { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' })}
+
{#each daySlots as slot (slot.id)}
- {@const seatsInBasket = basket.lines.find((l) => l.slot === slot.id)?.quantity ?? 0}
- {@const slotInBasket = seatsInBasket > 0}
+ {@const line = basket.lines.find((l) => l.slot === slot.id)}
{@const isGroup = slot.capacity > 1}
-
addSlot(item.id, slot.id)}
- class="inline-flex items-center gap-1.5 rounded-full border px-3.5 py-1.5 text-sm transition {slotInBasket
- ? `border-transparent bg-sage/15 text-sage-dark ${isGroup ? 'hover:bg-sage/30' : 'cursor-not-allowed'}`
- : 'border-charcoal/15 bg-white text-charcoal hover:border-sage hover:bg-sage/10'} disabled:opacity-60 {ui.adding &&
- !slotInBasket
- ? 'cursor-wait'
- : ''}"
- >
- {#if ui.pendingSlotId === slot.id}
-
- {/if}
- {formatTime(slot.start)}{item.duration != null ? ` · ${item.duration} min` : ''}{isGroup
- ? ` · ${slot.free} ${slot.free === 1 ? 'place' : 'places'} left`
- : ''}{slotInBasket ? (isGroup ? ` · ${seatsInBasket} in basket` : ' · In basket') : ''}
-
+ {@const label = `${formatTime(slot.start)}${item.duration != null ? ` · ${item.duration} min` : ''}`}
+ {#if isGroup && line}
+
+
+ {label} · {placesLeft(slot.free)}
+
+ changeSeats(item.id, line, -1)}
+ >
+ −
+
+
+ {#if ui.pendingSlotId === slot.id} {:else}{line.quantity}{/if}
+ {line.quantity === 1 ? 'place' : 'places'} in your basket
+
+ changeSeats(item.id, line, 1)}
+ >
+ +
+
+
+
+ {:else}
+
addSlot(item.id, slot.id)}
+ class="inline-flex items-center gap-1.5 rounded-full border px-3.5 py-1.5 text-sm transition {line
+ ? 'cursor-not-allowed border-transparent bg-sage/15 text-sage-dark'
+ : 'border-charcoal/15 bg-white text-charcoal hover:border-sage hover:bg-sage/10'} disabled:opacity-60 {ui.adding &&
+ !line
+ ? 'cursor-wait'
+ : ''}"
+ >
+ {#if ui.pendingSlotId === slot.id}
+
+ {/if}
+ {label}{isGroup ? ` · ${placesLeft(slot.free)}` : ''}{line ? ' · In basket' : ''}
+
+ {/if}
{/each}
- {:else}
+ {:else if anyShown}
Days with availability are highlighted{item.duration != null ? ` · ${item.duration} min per session` : ''}.