"use client"; import { useState, useEffect } from "react"; import type { ReactElement } from "react"; import { Calendar } from "@/components/calendar/Calendar"; import { mockEvents } from "@/lib/api/events"; import type { Event } from "@mosaic/shared"; export default function CalendarPage(): ReactElement { const [events, setEvents] = useState([]); const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(null); useEffect(() => { void loadEvents(); }, []); async function loadEvents(): Promise { setIsLoading(true); setError(null); try { // TODO: Replace with real API call when backend is ready // const data = await fetchEvents(); await new Promise((resolve) => setTimeout(resolve, 300)); setEvents(mockEvents); } catch (err) { setError( err instanceof Error ? err.message : "We had trouble loading your calendar. Please try again when you're ready." ); } finally { setIsLoading(false); } } return (

Calendar

View your schedule at a glance

{error !== null ? (

{error}

) : ( )}
); }