import { useState } from 'react' ; import { MaterialDatepickerProps } from './MaterialDatepicker' ; export const useMaterialDatepickerEffects = ( { onChange , } ) => { const [ open , setOpen ] = useState ( false ) ; const adornmentPosition = 'start' ; const handlePickerOpen = ( ) => setOpen ( true ) ; const handlePickerClose = ( ) => setOpen ( false ) ; const clearValue = ( e ) => { e . stopPropagation ( ) ; e . preventDefault ( ) ; onChange ( null ) ; } ; return { open , clearValue , handlePickerOpen , handlePickerClose , adornmentPosition , } ; } ;