File tree Expand file tree Collapse file tree 2 files changed +37
-2
lines changed
src/features/instance/config/overview/components Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change 11import { TextLoadingSkeleton } from '@/components/TextLoadingSkeleton' ;
2+ import { Button } from '@/components/ui/button' ;
3+ import { useCopyToClipboard } from '@/hooks/useCopyToClipboard' ;
24import { Cluster } from '@/lib/api.patch' ;
5+ import { CopyIcon } from 'lucide-react' ;
36
47export const ApplicationURL = ( {
58 loadingInstanceInfo,
@@ -8,10 +11,26 @@ export const ApplicationURL = ({
811 loadingInstanceInfo ?: boolean ;
912 clusterInfo ?: Cluster | undefined ;
1013} ) => {
14+ const [ onCopyClick ] = useCopyToClipboard ( clusterInfo ?. fqdn || '' ) ;
1115 return (
1216 < >
1317 < dt className = "font-bold text-sm/6" > Application URL</ dt >
14- < dd className = "text-sm/6 sm:mt-2" > { loadingInstanceInfo ? < TextLoadingSkeleton /> : clusterInfo ?. fqdn || 'N/A' } </ dd >
18+ < dd className = "text-sm/6 sm:mt-2" > { loadingInstanceInfo
19+ ? < TextLoadingSkeleton />
20+ : clusterInfo ?. fqdn
21+ ? < >
22+ { clusterInfo . fqdn }
23+ < Button
24+ className = "ml-2"
25+ type = "button"
26+ variant = "default"
27+ size = "sm"
28+ onClick = { onCopyClick }
29+ >
30+ < CopyIcon className = "w-4 h-4" />
31+ </ Button >
32+ </ >
33+ : 'N/A' } </ dd >
1534 </ >
1635 ) ;
1736} ;
Original file line number Diff line number Diff line change 11import { TextLoadingSkeleton } from '@/components/TextLoadingSkeleton' ;
2+ import { Button } from '@/components/ui/button' ;
3+ import { useCopyToClipboard } from '@/hooks/useCopyToClipboard' ;
24import { Instance } from '@/lib/api.patch' ;
35import { getOperationsUrlForInstance } from '@/lib/urls/getOperationsUrlForInstance' ;
46import { Link } from '@tanstack/react-router' ;
7+ import { CopyIcon } from 'lucide-react' ;
58import { useMemo } from 'react' ;
69
710export const InstanceURL = ( {
@@ -12,13 +15,26 @@ export const InstanceURL = ({
1215 instanceInfo ?: Instance | undefined ;
1316} ) => {
1417 const instanceUrl = useMemo ( ( ) => instanceInfo ? getOperationsUrlForInstance ( instanceInfo ) : null , [ instanceInfo ] ) ;
18+ const [ onCopyClick ] = useCopyToClipboard ( instanceUrl || '' ) ;
1519 return (
1620 < >
1721 < dt className = "font-bold text-sm/6" > Operations URL</ dt >
1822 < dd className = "text-sm/6 sm:mt-2" > { loadingInstanceInfo
1923 ? ( < TextLoadingSkeleton /> )
2024 : instanceUrl
21- ? ( < Link to = { instanceUrl } target = "_blank" className = "underline hover:text-blue-300" > { instanceUrl } </ Link > )
25+ ? (
26+ < >
27+ < Link to = { instanceUrl } target = "_blank" className = "underline hover:text-blue-300" > { instanceUrl } </ Link >
28+ < Button
29+ className = "ml-2"
30+ type = "button"
31+ variant = "default"
32+ size = "sm"
33+ onClick = { onCopyClick }
34+ >
35+ < CopyIcon className = "w-4 h-4" />
36+ </ Button >
37+ </ > )
2238 : 'N/A' } </ dd >
2339 </ >
2440 ) ;
You can’t perform that action at this time.
0 commit comments