import React from "react"; // headless ui import { Popover, Transition } from "@headlessui/react"; // ui import { CustomMenu, ToggleSwitch } from "components/ui"; // icons import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "@heroicons/react/24/outline"; // helpers import { formatDate, isSameMonth, isSameYear, updateDateWithMonth, updateDateWithYear, } from "helpers/calendar.helper"; // constants import { MONTHS_LIST, YEARS_LIST } from "constants/calendar"; type Props = { currentDate: Date; setCurrentDate: React.Dispatch>; showWeekEnds: boolean; setShowWeekEnds: React.Dispatch>; }; export const CalendarHeader: React.FC = ({ currentDate, setCurrentDate, showWeekEnds, setShowWeekEnds, }) => (
{({ open }) => ( <>
{formatDate(currentDate, "Month")}{" "} {formatDate(currentDate, "yyyy")}
{YEARS_LIST.map((year) => ( ))}
{MONTHS_LIST.map((month) => ( ))}
)}
Options
} >

Show weekends

setShowWeekEnds(!showWeekEnds)} />
); export default CalendarHeader;