import { ReactNode, forwardRef } from 'react' import { BsPrefixRefForwardingComponent } from 'react-bootstrap-5/helpers' import type { DropdownToggleProps } from '@/features/ui/components/types/dropdown-menu-props' import { DropdownToggle as BS5DropdownToggle, OverlayTrigger, OverlayTriggerProps, Tooltip, } from 'react-bootstrap-5' import type { MergeAndOverride } from '../../../../../../types/utils' type DropdownToggleWithTooltipProps = MergeAndOverride< DropdownToggleProps, { children: ReactNode overlayTriggerProps?: Omit toolTipDescription: string tooltipProps?: Omit, 'children'> 'aria-label'?: string } > const DropdownToggleWithTooltip = forwardRef< BsPrefixRefForwardingComponent<'button', DropdownToggleProps>, DropdownToggleWithTooltipProps >( ( { children, toolTipDescription, overlayTriggerProps, tooltipProps, id, ...toggleProps }, ref ) => { return ( {toolTipDescription}} {...overlayTriggerProps} > {children} ) } ) DropdownToggleWithTooltip.displayName = 'DropdownToggleWithTooltip' export default DropdownToggleWithTooltip