1- import { ButtonDomRef , FlexBox , Icon , ResponsivePopover , Text } from '@ui5/webcomponents-react' ;
1+ import { Button , ButtonDomRef , FlexBox , Icon , ResponsivePopover , Text } from '@ui5/webcomponents-react' ;
22import { formatDateAsTimeAgo } from '../../utils/i18n/timeAgo' ;
33import { useRef , useState } from 'react' ;
44import { AnimatedHoverTextButton } from '../Helper/AnimatedHoverTextButton.tsx' ;
@@ -10,13 +10,15 @@ export interface ResourceStatusCellProps {
1010 message ?: string ;
1111 positiveText : string ;
1212 negativeText : string ;
13+ hideOnHoverEffect ?: boolean ;
1314}
1415export const ResourceStatusCell = ( {
1516 isOk,
1617 transitionTime,
1718 message,
1819 positiveText,
1920 negativeText,
21+ hideOnHoverEffect
2022} : ResourceStatusCellProps ) => {
2123 const btnRef = useRef < ButtonDomRef > ( null ) ;
2224 const [ popoverIsOpen , setPopoverIsOpen ] = useState ( false ) ;
@@ -29,19 +31,37 @@ export const ResourceStatusCell = ({
2931 } ;
3032 return (
3133 < span >
32- < AnimatedHoverTextButton
33- ref = { btnRef }
34- icon = {
34+ { hideOnHoverEffect ? (
35+ < Button
36+ ref = { btnRef }
37+ design = "Transparent"
38+ onClick = { handleOpen }
39+ title = { transitionTime ? formatDateAsTimeAgo ( transitionTime ) : '-' }
40+ aria-label = { transitionTime ? formatDateAsTimeAgo ( transitionTime ) : '-' }
41+ >
3542 < Icon
3643 design = { isOk ? 'Positive' : 'Negative' }
3744 name = { isOk ? 'sys-enter-2' : 'sys-cancel-2' }
3845 showTooltip = { true }
3946 accessibleName = { transitionTime ? formatDateAsTimeAgo ( transitionTime ) : '-' }
4047 />
41- }
42- text = { isOk ? positiveText : negativeText }
43- onClick = { handleOpen }
44- />
48+ </ Button >
49+ ) : (
50+ < AnimatedHoverTextButton
51+ ref = { btnRef }
52+ icon = {
53+ < Icon
54+ design = { isOk ? 'Positive' : 'Negative' }
55+ name = { isOk ? 'sys-enter-2' : 'sys-cancel-2' }
56+ showTooltip = { true }
57+ accessibleName = { transitionTime ? formatDateAsTimeAgo ( transitionTime ) : '-' }
58+ />
59+ }
60+ text = { isOk ? positiveText : negativeText }
61+ onClick = { handleOpen }
62+ />
63+ ) }
64+
4565 < ResponsivePopover
4666 opener = { btnRef . current ?? undefined }
4767 open = { popoverIsOpen }
0 commit comments