// @fullcalendar components import FullCalendar from "@fullcalendar/react" import dayGridPlugin from "@fullcalendar/daygrid" import timeGridPlugin from "@fullcalendar/timegrid" import interactionPlugin from "@fullcalendar/interaction" // @mui material components import Card from "@mui/material/Card" // ThreeD Garden components import MDBox from "~/components/mui/MDBox" import MDTypography from "~/components/mui/MDTypography" // Custom styles for Calendar import CalendarRoot from "~/components/elements/Calendar/CalendarRoot" // ThreeD Garden context import { useMaterialUIController } from "~/context" // Declaring props types for the Calender interface Props { header?: { title?: string date?: string } [key: string]: any } function Calendar({ header, ...rest }: Props): JSX.Element { const [controller] = useMaterialUIController() const { darkMode } = controller const validClassNames = [ "primary", "secondary", "info", "success", "warning", "error", "light", "dark", ] const events = rest.events ? rest.events.map((el: any) => ({ ...el, className: validClassNames.find((item) => item === el.className) ? `event-${el.className}` : "event-info", })) : [] return ( {header.title ? ( {header.title} ) : null} {header.date ? ( {header.date} ) : null} ) } // Declaring default props for Calendar Calendar.defaultProps = { header: { title: "", date: "", }, } export default Calendar