imporvements
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user