import { FormControl, FormLabel, Select, SelectProps, Tooltip, TooltipProps, } from '@chakra-ui/react'; import { memo, MouseEvent } from 'react'; import IAIOption from './IAIOption'; type IAISelectProps = SelectProps & { label?: string; tooltip?: string; tooltipProps?: Omit; validValues: | Array | Array<{ key: string; value: string | number }>; }; /** * Customized Chakra FormControl + Select multi-part component. */ const IAISelect = (props: IAISelectProps) => { const { label, isDisabled, validValues, tooltip, tooltipProps, ...rest } = props; return ( ) => { e.stopPropagation(); e.nativeEvent.stopImmediatePropagation(); e.nativeEvent.stopPropagation(); e.nativeEvent.cancelBubble = true; }} > {label && {label}} ); }; export default memo(IAISelect);