diff --git a/src/views/components/calendar/CalendarSchedules.tsx b/src/views/components/calendar/CalendarSchedules.tsx index 4320239b9..6a5052423 100644 --- a/src/views/components/calendar/CalendarSchedules.tsx +++ b/src/views/components/calendar/CalendarSchedules.tsx @@ -9,6 +9,8 @@ import React from 'react'; import AddSchedule from '~icons/material-symbols/add'; +import { usePrompt } from '../common/DialogProvider/DialogProvider'; + /** * Renders a component that displays a list of schedules. * @@ -17,6 +19,33 @@ import AddSchedule from '~icons/material-symbols/add'; */ export function CalendarSchedules() { const [, schedules] = useSchedules(); + const showDialog = usePrompt(); + + const handleAddSchedule = () => { + if (schedules.length >= 10) { + showDialog({ + title: `You have 10 active schedules!`, + + description: ( + <> + To encourage organization,{' '} + please consider removing some unused schedules you + may have. + > + ), + // eslint-disable-next-line react/no-unstable-nested-components + buttons: close => ( + + ), + }); + + return; + } + + createSchedule('New Schedule'); + }; return (