'use client'
import { useState } from 'react'
import DatePicker from 'react-datepicker'
import 'react-datepicker/dist/react-datepicker.css'

export default function RangeDatePicker() {
  
  const [dateRange, setDateRange] = useState([null, null])
  const [startRangeDate, endRangeDate] = dateRange

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