import React, { useEffect } from 'react'; import { Link } from 'react-router-dom'; import { CalendarToday, KeyboardArrowRight } from '@mui/icons-material'; import useTimetableStore from '../../stores/timetableStore'; import { format, parseISO } from 'date-fns'; const TimetableListPage: React.FC = () => { const { timetables, timetablesLoading, timetablesError, fetchMyTimetables } = useTimetableStore(); useEffect(() => { fetchMyTimetables(); }, [fetchMyTimetables]); if (timetablesLoading) { return (
{timetablesError}
Your scheduled timetables
Timetables are created from a class. Go to{' '} Classes{' '} to get started.
{format(parseISO(timetable.start_date), 'MMM d, yyyy')} {timetable.end_date ? ` – ${format(parseISO(timetable.end_date), 'MMM d, yyyy')}` : ' (ongoing)'}