import { memo } from 'react' import { Button } from '@/components/ui/button' import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from '@/components/ui/tooltip' interface ButtonItem { label: string disabled?: boolean tooltip?: string } interface InteractionButtonsProps { items: Array disabled?: boolean isClicked?: boolean onClick: (label: string) => void } export const InteractionButtons = memo( ({ items, disabled, isClicked, onClick }: InteractionButtonsProps) => { if (!items?.length) return null return (
{items.map((item, idx) => { const label = typeof item === 'string' ? item : item.label const btnDisabled = typeof item === 'string' ? false : !!item.disabled const tooltip = typeof item === 'string' ? undefined : item.tooltip const button = ( ) return tooltip ? ( {button} {tooltip} ) : ( button ) })}
) }, )