import React from 'react'; import styles from './CalendarGrid.module.scss'; import CalendarCell from '../CalendarGridCell/CalendarGridCell'; import { DAY_MAP } from 'src/shared/types/CourseMeeting'; const daysOfWeek = Object.values(DAY_MAP); daysOfWeek.pop(); daysOfWeek.pop(); const hoursOfDay = Array.from({ length: 14 }, (_, index) => index + 8); const grid = Array.from({ length: 5 }, () => Array.from({ length: 13 }, (_, columnIndex) => ( )) ); /** * Grid of CalendarGridCell components forming the user's course schedule calendar view * @param props */ const Calendar: React.FC = (props) => { return (
{/* Empty cell in the top-left corner */}
{/* Displaying day labels */} {daysOfWeek.map(day => (
{day}
))}
{/* Displaying the rest of the calendar */}
{hoursOfDay.map((hour) => (

{hour % 12 === 0 ? 12 : hour % 12}:00 {hour < 12 ? 'AM' : 'PM'}

))}
{grid.map((row, rowIndex) => ( row ))}
) }; export default Calendar;