(onClick?: () => void)
| 138 | }; |
| 139 | |
| 140 | const renderButton = (onClick?: () => void) => ( |
| 141 | <Button |
| 142 | variant={buttonVariant} |
| 143 | size={size} |
| 144 | className={buttonClass} |
| 145 | aria-label={t("plugin.ai.ai-assistant")} |
| 146 | onClick={onClick} |
| 147 | > |
| 148 | {icon} |
| 149 | </Button> |
| 150 | ); |
| 151 | |
| 152 | if (!hasActions) { |
| 153 | return renderButton(handleToggle); |