import React, { useEffect, useMemo, useRef } from "react"; import { CalendarDate, createCalendar, DateValue, GregorianCalendar, toCalendar, } from "@internationalized/date"; import { useDateFormatter, useLocale } from "@react-aria/i18n"; import { useCalendarState } from "@react-stately/calendar"; import { useCalendar } from "@react-aria/calendar"; import { useSelect, UseSelectReturnValue, UseSelectStateChange, } from "downshift"; import classNames from "classnames"; import { CalendarProps } from "react-aria"; import { range } from ":/utils"; import { Button } from ":/components/Button"; import { CalendarGrid } from ":/components/Forms/DatePicker/CalendarGrid"; import { useCunningham } from ":/components/Provider"; // todo to be factorized with the select component interface Option { value: number; label: string; disabled?: boolean; } // todo to be factorized with the select component const optionToString = (option: Option | null) => { return option ? option.label : ""; }; type DropdownValuesProps = { options: Array