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

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

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

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

export default StaticDatePicker;