import DatePicker from 'react-datepicker'
import 'react-datepicker/dist/react-datepicker.css'

export default function RangeDatePicker(props) {
  const { startRangeDate, endRangeDate, setDateRange } = props

  return (
    <DatePicker
      dateFormat={`yyyy-MM-dd`}
      selectsRange={true}
      startDate={startRangeDate}
      endDate={endRangeDate}
      onChange={(update) => {
        setDateRange(update)
      }}
      isClearable={true}
    />
  )
}
