@@ -95,16 +132,34 @@ export function DateTimePicker({ value, onChange, occupiedDates = [], placeholde
mode="single"
selected={selectedDate}
onSelect={handleDateSelect}
+ month={month}
+ onMonthChange={setMonth}
locale={fr}
modifiers={{
- occupied: (date) => isDateOccupied(date)
+ selectedStoreBusy: isSelectedStoreBusy,
+ otherStoreBusy: isOtherStoreBusy,
}}
modifiersClassNames={{
- occupied: "bg-destructive/15 text-destructive font-bold hover:bg-destructive/25"
+ selectedStoreBusy: "bg-destructive/15 text-destructive font-bold hover:bg-destructive/25",
+ otherStoreBusy: "bg-muted font-semibold",
}}
+ components={{ DayContent: AgendaDayContent }}
disabled={(date) => date < new Date(new Date().setHours(0, 0, 0, 0))}
data-testid="calendar-picker"
/>
+
+
+
+ Déjà prévu sur un magasin sélectionné
+
+
+
+ Prévu sur d'autres magasins
+
+ {selectedPageIds.length === 0 && (
+
Cochez un magasin pour repérer ses jours déjà occupés.
+ )}
+
{value && (
@@ -147,7 +202,9 @@ export function DateTimePicker({ value, onChange, occupiedDates = [], placeholde
Heures
- {hours.map((hour) => (
+ {hours.map((hour) => {
+ const taken = hoursTaken.get(hour) ?? 0;
+ return (
- ))}
+ );
+ })}
@@ -194,20 +260,21 @@ export function DateTimePicker({ value, onChange, occupiedDates = [], placeholde
Heures optimales (8h, 12h-13h, 18h-20h)
+ {hoursTaken.size > 0 && (
+