import React from "react";
import PropTypes from 'prop-types';
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";

//destructure props
const Datepicker = ({date,onChange}) => {
    return <DatePicker
	       closeOnScroll={true}
	       selected={date}
	       onChange={onChange}
	   >
		<div style={{ color: "red" }}>
		    Please select a day from the calendar!
		</div>
	    </DatePicker>;
};

export default Datepicker;
Datepicker.propTypes = {
    date: PropTypes.object,
    onChange: PropTypes.func
};
