1+ import React from 'react' ;
2+
13import { Code , Link , Xmark } from '@gravity-ui/icons' ;
2- import { Button , Icon } from '@gravity-ui/uikit' ;
4+ import { ActionTooltip , Button , Icon } from '@gravity-ui/uikit' ;
35
46import EnableFullscreenButton from '../../../../components/EnableFullscreenButton/EnableFullscreenButton' ;
57import Fullscreen from '../../../../components/Fullscreen/Fullscreen' ;
@@ -29,15 +31,22 @@ export const QueryDetails = ({
2931 onOpenInEditor,
3032 onCopyLink,
3133} : QueryDetailsProps ) => {
34+ const [ isTooltipOpen , setIsTooltipOpen ] = React . useState ( false ) ;
35+
3236 // Function to copy current URL to clipboard
3337 const copyLinkToClipboard = ( e : React . MouseEvent ) => {
3438 e . stopPropagation ( ) ;
3539
40+ setIsTooltipOpen ( true ) ;
3641 // If onCopyLink is provided, call it to generate and copy a shareable URL
3742 // The actual copy to clipboard is handled in the parent component
3843 if ( onCopyLink ) {
3944 onCopyLink ( ) ;
4045 }
46+
47+ setTimeout ( ( ) => {
48+ setIsTooltipOpen ( false ) ;
49+ } , 1000 ) ;
4150 } ;
4251
4352 return (
@@ -46,13 +55,19 @@ export const QueryDetails = ({
4655 < div className = { b ( 'title' ) } > Query</ div >
4756 < div className = { b ( 'actions' ) } >
4857 { onCopyLink && (
49- < Button
50- view = "flat-secondary"
51- onClick = { copyLinkToClipboard }
52- title = { i18n ( 'query-details.copy- link' ) }
58+ < ActionTooltip
59+ disabled = { ! isTooltipOpen }
60+ closeDelay = { 1000 }
61+ title = { i18n ( 'query-details.link-copied ' ) }
5362 >
54- < Icon data = { Link } size = { 16 } />
55- </ Button >
63+ < Button
64+ view = "flat-secondary"
65+ onClick = { copyLinkToClipboard }
66+ title = { i18n ( 'query-details.copy-link' ) }
67+ >
68+ < Icon data = { Link } size = { 16 } />
69+ </ Button >
70+ </ ActionTooltip >
5671 ) }
5772 < EnableFullscreenButton />
5873 < Button view = "flat-secondary" onClick = { onClose } >
0 commit comments