Update workbench events (#30254)
GitOrigin-RevId: 7434483ce125676f1d7d76dfcb09d6691f9dadef
This commit is contained in:
@@ -9,7 +9,8 @@ export const CopyToClipboard = memo<{
|
||||
tooltipId: string
|
||||
kind?: 'text' | 'icon'
|
||||
unfilled?: boolean
|
||||
}>(({ content, tooltipId, kind = 'icon', unfilled = false }) => {
|
||||
onClick?: () => void
|
||||
}>(({ content, tooltipId, kind = 'icon', unfilled = false, onClick }) => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
const [copied, setCopied] = useState(false)
|
||||
@@ -21,7 +22,10 @@ export const CopyToClipboard = memo<{
|
||||
setCopied(false)
|
||||
}, 1500)
|
||||
})
|
||||
}, [content])
|
||||
if (onClick) {
|
||||
onClick()
|
||||
}
|
||||
}, [content, onClick])
|
||||
|
||||
if (!navigator.clipboard?.writeText) {
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user