1- import { Button , ButtonDomRef , Link , LinkDomRef , FlexBox , FlexBoxAlignItems , Text } from '@ui5/webcomponents-react' ;
1+ import { Button , ButtonDomRef , FlexBox , FlexBoxAlignItems } from '@ui5/webcomponents-react' ;
22import '@ui5/webcomponents-icons/dist/copy' ;
33import { JSX , useId , useState } from 'react' ;
44import type { Ui5CustomEvent } from '@ui5/webcomponents-react-base' ;
55import type { ButtonClickEventDetail } from '@ui5/webcomponents/dist/Button.js' ;
6- import type { LinkClickEventDetail } from '@ui5/webcomponents/dist/Link.js' ;
6+
77import styles from './AnimatedHoverTextButton.module.css' ;
88import { getClassNameForOverallStatus } from '../ControlPlane/MCPHealthPopoverButton.tsx' ;
99import { ReadyStatus } from '../../lib/api/types/crate/controlPlanes.ts' ;
@@ -12,9 +12,7 @@ type HoverTextButtonProps = {
1212 id ?: string ;
1313 text : string ;
1414 icon : JSX . Element ;
15- onClick : (
16- event : Ui5CustomEvent < ButtonDomRef , ButtonClickEventDetail > | Ui5CustomEvent < LinkDomRef , LinkClickEventDetail > ,
17- ) => void ;
15+ onClick : ( event : Ui5CustomEvent < ButtonDomRef , ButtonClickEventDetail > ) => void ;
1816 large ?: boolean ;
1917} ;
2018export const AnimatedHoverTextButton = ( { id, text, icon, onClick, large = false } : HoverTextButtonProps ) => {
@@ -26,29 +24,30 @@ export const AnimatedHoverTextButton = ({ id, text, icon, onClick, large = false
2624 const content = (
2725 < FlexBox alignItems = { FlexBoxAlignItems . Center } >
2826 { hover || large ? (
29- < Text
27+ < span
3028 className = { cx ( styles . text , styles [ getClassNameForOverallStatus ( text as ReadyStatus ) ] , {
3129 [ styles . large ] : large ,
3230 } ) }
3331 >
3432 { text }
35- </ Text >
33+ </ span >
3634 ) : null }
3735 { icon }
3836 </ FlexBox >
3937 ) ;
4038
4139 if ( large ) {
4240 return (
43- < Link
41+ < Button
4442 id = { id }
43+ design = { 'Transparent' }
4544 className = { cx ( styles . link , styles [ getClassNameForOverallStatus ( text ? ( text as ReadyStatus ) : undefined ) ] ) }
4645 onClick = { onClick }
4746 onMouseLeave = { ( ) => setHover ( false ) }
4847 onMouseOver = { ( ) => setHover ( true ) }
4948 >
5049 { content }
51- </ Link >
50+ </ Button >
5251 ) ;
5352 }
5453
0 commit comments