import { Button, ButtonProps, Tooltip } from 'antd'; import clsx from 'clsx'; import React from 'react'; import { isValidStr } from 'tailchat-shared'; import { Icon } from 'tailchat-design'; type IconBtnShapeType = 'circle' | 'square'; function calcShape( inputShape: IconBtnShapeType = 'circle' ): ButtonProps['shape'] { if (inputShape === 'circle') { return 'circle'; } return 'default'; } interface IconBtnProps extends Omit { icon: string; iconClassName?: string; shape?: IconBtnShapeType; title?: string; active?: boolean; } export const IconBtn: React.FC = React.memo( ({ icon, iconClassName, title, className, ...props }) => { const shape = calcShape(props.shape); const iconEl = ( ); // 默认情况下的背景颜色 const normalBg = props.active ? 'bg-black bg-opacity-60' : 'bg-black bg-opacity-20 hover:bg-opacity-60'; const btnEl = (