diff --git a/apps/web/lib/features/daily-plan/all-plans-modal.tsx b/apps/web/lib/features/daily-plan/all-plans-modal.tsx index b12cf295f..1744d094b 100644 --- a/apps/web/lib/features/daily-plan/all-plans-modal.tsx +++ b/apps/web/lib/features/daily-plan/all-plans-modal.tsx @@ -16,6 +16,8 @@ interface IAllPlansModal { isOpen: boolean; } +type CalendarTab = 'Today' | 'Tomorrow' | 'Calendar'; + /** * A modal that displays all the plans available to the user (Today, Tomorrow and Future). * @@ -62,15 +64,15 @@ export const AllPlansModal = memo(function AllPlansModal(props: IAllPlansModal) }, [closeModal]); // Define tabs for plan selection - const tabs = useMemo(() => ['Today', 'Tomorrow', 'Future'], []); + const tabs: CalendarTab[] = useMemo(() => ['Today', 'Tomorrow', 'Calendar'], []); // State to track the active tab const [selectedTab, setSelectedTab] = useState(tabs[0]); // Handle tab switching - const handleTabClick = (tab: string) => { + const handleTabClick = (tab: CalendarTab) => { setSelectedTab(tab); - setShowCalendar(tab === 'Future'); + setShowCalendar(tab === 'Calendar'); setShowCustomPlan(false); }; @@ -81,7 +83,7 @@ export const AllPlansModal = memo(function AllPlansModal(props: IAllPlansModal) return todayPlan; case 'Tomorrow': return tomorrowPlan; - case 'Future': + case 'Calendar': return selectedFuturePlan; default: return undefined; @@ -112,7 +114,7 @@ export const AllPlansModal = memo(function AllPlansModal(props: IAllPlansModal)
- {selectedTab === 'Future' && showCustomPlan && ( + {selectedTab === 'Calendar' && showCustomPlan && (
@@ -153,7 +155,7 @@ export const AllPlansModal = memo(function AllPlansModal(props: IAllPlansModal)
- {selectedTab === 'Future' && showCalendar ? ( + {selectedTab === 'Calendar' && showCalendar ? (