import { useCallback } from 'react' ; import { UseSelectProps , ValueType , Option } from '../../../types' ; import useSelectHandler from '../use-select-handler' ; const useItemOnClick = < T extends ValueType , M extends boolean = false > ( { selectState : { close } , selectProps : { multiple } , handleSelect } ) => useCallback ( ( event , item ) => { if ( ! multiple ) { close ( ) ; } handleSelect ( event , item ) ; } , [ close , handleSelect , multiple ] ) ; export default useItemOnClick ;