import type { Course } from '@shared/types/Course'; import Text from '@views/components/common/Text/Text'; import { ColorPickerProvider } from '@views/contexts/ColorPickerContext'; import type { CalendarGridCourse } from '@views/hooks/useFlattenedCourseSchedule'; import clsx from 'clsx'; import type { ReactNode } from 'react'; import React from 'react'; import CalendarCourseBlock from './CalendarCourseCell'; type CalendarBottomBarProps = { courseCells?: CalendarGridCourse[]; setCourse: React.Dispatch>; }; /** * Renders the bottom bar of the calendar component. * * @param courses - The list of courses to display in the calendar. * @returns The rendered bottom bar component. */ export default function CalendarBottomBar({ courseCells, setCourse }: CalendarBottomBarProps): ReactNode { const asyncCourseCells = courseCells?.filter(block => block.async); const displayCourses = asyncCourseCells && asyncCourseCells.length > 0; if (!displayCourses) return null; return (
Async / Other
{asyncCourseCells.map(block => { const { courseDeptAndInstr, status, className } = block.componentProps; return ( setCourse(block.course)} blockData={block} /> ); })}
); }