import { DatePicker } from "@material-ui/pickers";
import { makeStyles } from '@material-ui/core'

interface IStaticDatePicker {
  date: Date,
  changeDate: React.Dispatch<React.SetStateAction<any>>,
  handleOnOpen: () => void
}

const useStyles = makeStyles({
container: {
  position: 'absolute',
},
})

const StaticDatePicker = ({ date, changeDate,handleOnOpen }: IStaticDatePicker) => {
    const classes = useStyles()
return (
  <DatePicker
    className={classes.container}
    inputVariant='outlined'
    orientation="portrait"
    variant="dialog"
    openTo="date"
    autoOk
    value={date?date:new Date()}
    onOpen={handleOnOpen}
    onChange={changeDate}
    />
  );
};

export default StaticDatePicker;