add more chat utils (retry, edit, delete)

This commit is contained in:
josc146
2023-06-21 21:20:21 +08:00
parent 35a7437714
commit 4cd5a56070
5 changed files with 205 additions and 99 deletions

View File

@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
import { ClipboardSetText } from '../../wailsjs/runtime';
import { ToolTipButton } from './ToolTipButton';
export const CopyButton: FC<{ content: string }> = ({ content }) => {
export const CopyButton: FC<{ content: string, showDelay?: number, }> = ({ content, showDelay = 0 }) => {
const { t } = useTranslation();
const [copied, setCopied] = useState(false);
@@ -19,7 +19,8 @@ export const CopyButton: FC<{ content: string }> = ({ content }) => {
};
return (
<ToolTipButton desc={t('Copy')} size="small" appearance="subtle" icon={copied ? <CheckIcon /> : <CopyIcon />}
<ToolTipButton desc={t('Copy')} size="small" appearance="subtle" showDelay={showDelay}
icon={copied ? <CheckIcon /> : <CopyIcon />}
onClick={onClick} />
);
};