import { FunctionComponent } from "preact";
import { Calendar } from "primereact/calendar";
import { FormEvent } from "primereact/ts-helpers";

interface DatePickerProps {
  value?: Date;
  onChange?: (e: FormEvent<Date>) => void;
}

const DatePicker: FunctionComponent<DatePickerProps> = ({ value = new Date(), onChange }: DatePickerProps) => {
  return <Calendar value={value} onChange={onChange} />;
};

export default DatePicker;
