import * as Popover from "@radix-ui/react-popover"; import { format } from "date-fns"; import classNames from "@calcom/ui/classNames"; import { Button } from "../../button/Button"; import { Calendar } from "../date-range-picker/Calendar"; type Props = { date: Date; onDatesChange?: ((date: Date) => void) | undefined; className?: string; disabled?: boolean; minDate?: Date | null; label?: string; }; const DatePicker = ({ minDate, disabled, date, onDatesChange, className, label }: Props) => { function handleDayClick(newDate: Date) { onDatesChange?.(newDate ?? new Date()); } const fromDate = minDate ?? new Date(); const calendar = ( handleDayClick(day)} numberOfMonths={1} disabled={disabled} /> ); return (
{/* modal prop required for iOS compatibility when nested inside Dialog modals */} {calendar}
); }; export default DatePicker;