feat: tooltip (#7634)
This commit is contained in:
parent
1ba3d3acd6
commit
3be756eaed
93 changed files with 640 additions and 758 deletions
|
|
@ -1,10 +1,9 @@
|
|||
'use client'
|
||||
import { useRef, useState } from 'react'
|
||||
import { useState } from 'react'
|
||||
import { t } from 'i18next'
|
||||
import copy from 'copy-to-clipboard'
|
||||
import s from './style.module.css'
|
||||
import Tooltip from '@/app/components/base/tooltip'
|
||||
import { randomString } from '@/utils'
|
||||
|
||||
type ICopyBtnProps = {
|
||||
value: string
|
||||
|
|
@ -18,14 +17,11 @@ const CopyBtn = ({
|
|||
isPlain,
|
||||
}: ICopyBtnProps) => {
|
||||
const [isCopied, setIsCopied] = useState(false)
|
||||
const selector = useRef(`copy-tooltip-${randomString(4)}`)
|
||||
|
||||
return (
|
||||
<div className={`${className}`}>
|
||||
<Tooltip
|
||||
selector={selector.current}
|
||||
content={(isCopied ? t('appApi.copied') : t('appApi.copy')) as string}
|
||||
className='z-10'
|
||||
popupContent={(isCopied ? t('appApi.copied') : t('appApi.copy'))}
|
||||
>
|
||||
<div
|
||||
className={'box-border p-0.5 flex items-center justify-center rounded-md bg-white cursor-pointer'}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue