From a430284aa21e3ae1f0d5654e55b2ad2852519cc2 Mon Sep 17 00:00:00 2001 From: wwf <yearningwang@iqtogether.com> Date: 星期三, 04 六月 2025 15:17:49 +0800 Subject: [PATCH] 初始化 --- app/components/base/copy-btn/index.tsx | 21 ++++++--------------- 1 files changed, 6 insertions(+), 15 deletions(-) diff --git a/app/components/base/copy-btn/index.tsx b/app/components/base/copy-btn/index.tsx index 88c8ba6..2acb5d8 100644 --- a/app/components/base/copy-btn/index.tsx +++ b/app/components/base/copy-btn/index.tsx @@ -1,7 +1,6 @@ 'use client' import { useState } from 'react' import { t } from 'i18next' -import { debounce } from 'lodash-es' import copy from 'copy-to-clipboard' import s from './style.module.css' import Tooltip from '@/app/components/base/tooltip' @@ -19,32 +18,24 @@ }: ICopyBtnProps) => { const [isCopied, setIsCopied] = useState(false) - const onClickCopy = debounce(() => { - copy(value) - setIsCopied(true) - }, 100) - - const onMouseLeave = debounce(() => { - setIsCopied(false) - }, 100) - return ( <div className={`${className}`}> <Tooltip popupContent={(isCopied ? t('appApi.copied') : t('appApi.copy'))} - asChild={false} > <div - onMouseLeave={onMouseLeave} - className={'box-border flex cursor-pointer items-center justify-center rounded-md bg-components-button-secondary-bg p-0.5'} + className={'box-border p-0.5 flex items-center justify-center rounded-md bg-white cursor-pointer'} style={!isPlain ? { boxShadow: '0px 4px 8px -2px rgba(16, 24, 40, 0.1), 0px 2px 4px -2px rgba(16, 24, 40, 0.06)', } : {}} - onClick={onClickCopy} + onClick={() => { + copy(value) + setIsCopied(true) + }} > - <div className={`h-6 w-6 rounded-md hover:bg-components-button-secondary-bg-hover ${s.copyIcon} ${isCopied ? s.copied : ''}`}></div> + <div className={`w-6 h-6 rounded-md hover:bg-gray-50 ${s.copyIcon} ${isCopied ? s.copied : ''}`}></div> </div> </Tooltip> </div> -- Gitblit v1.8.0