// @flow
import PropTypes from 'prop-types';

type ReactDayPickerDisableDatesConfig = {
  before?: Date,
  after?: Date,
};

export type DatepickerProps = {
  label: string,
  onChange: Date => void,
  value?: Date,
  disabledDates?: Array<Date | ReactDayPickerDisableDatesConfig>,
  disableWeekends?: boolean,
  disablePastDates?: boolean,
};

export const datepickerPropTypes = {
  label: PropTypes.string.isRequired,
  onChange: PropTypes.func.isRequired,
  value: PropTypes.instanceOf(Date),
  disabledDates: PropTypes.arrayOf(PropTypes.instanceOf(Date)),
  disableWeekends: PropTypes.bool,
  disablePastDates: PropTypes.bool,
};
