imporvements

This commit is contained in:
Joyce
2026-02-02 13:49:11 -05:00
parent 10675b6846
commit 192b885149
6 changed files with 134 additions and 18 deletions

View File

@@ -62,6 +62,7 @@ const Index = ({ defaultTab = 'schedule' }: IndexProps) => {
const [selectedSlot, setSelectedSlot] = useState<TimeSlot | null>(null);
const [isModalOpen, setIsModalOpen] = useState(false);
const [settings, setSettings] = useState<SettingsState>(defaultSettings);
const [weekOffset, setWeekOffset] = useState(0);
const [isLoading, setIsLoading] = useState(false);
const [isSyncing, setIsSyncing] = useState(false);
const { toast } = useToast();
@@ -101,7 +102,7 @@ const Index = ({ defaultTab = 'schedule' }: IndexProps) => {
} else {
setAvailabilitySlots([]);
}
}, [selectedParticipants]);
}, [selectedParticipants, weekOffset]);
const loadParticipants = async () => {
try {
@@ -120,7 +121,7 @@ const Index = ({ defaultTab = 'schedule' }: IndexProps) => {
setIsLoading(true);
try {
const ids = selectedParticipants.map((p) => p.id);
const slots = await fetchAvailability(ids);
const slots = await fetchAvailability(ids, weekOffset);
setAvailabilitySlots(slots);
} catch (error) {
toast({
@@ -325,6 +326,8 @@ const Index = ({ defaultTab = 'schedule' }: IndexProps) => {
onSlotSelect={handleSlotSelect}
showPartialAvailability={settings.showPartialAvailability}
isLoading={isLoading}
weekOffset={weekOffset}
onWeekOffsetChange={setWeekOffset}
/>
</>
)}