import React from 'react' ; import { createHook } from '@workday/canvas-kit-react/common' ; import { SelectionModel } from './useSelectionModel' ; export const useSelectionItem = createHook ( ( { state , events } , _ ? , elemProps = { } ) => { const name = elemProps . name || '' ; const onClick = ( event ) => { if ( state . nonInteractiveIds . includes ( name ) || event . currentTarget . hasAttribute ( 'aria-disabled' ) ) { return ; } events . select ( { id : name } ) ; } ; return { onClick } ; } ) ;