@@ -22,6 +22,7 @@ export const ResourceStatusCell = ({
2222} : ResourceStatusCellProps ) => {
2323 const btnRef = useRef < ButtonDomRef > ( null ) ;
2424 const [ popoverIsOpen , setPopoverIsOpen ] = useState ( false ) ;
25+ const timeAgo = transitionTime ? formatDateAsTimeAgo ( transitionTime ) : '-' ;
2526
2627 const handleClose = ( ) => {
2728 setPopoverIsOpen ( false ) ;
@@ -36,14 +37,14 @@ export const ResourceStatusCell = ({
3637 ref = { btnRef }
3738 design = "Transparent"
3839 onClick = { handleOpen }
39- title = { transitionTime ? formatDateAsTimeAgo ( transitionTime ) : '-' }
40- aria-label = { transitionTime ? formatDateAsTimeAgo ( transitionTime ) : '-' }
40+ title = { timeAgo }
41+ aria-label = { timeAgo }
4142 >
4243 < Icon
4344 design = { isOk ? 'Positive' : 'Negative' }
4445 name = { isOk ? 'sys-enter-2' : 'sys-cancel-2' }
4546 showTooltip = { true }
46- accessibleName = { transitionTime ? formatDateAsTimeAgo ( transitionTime ) : '-' }
47+ accessibleName = { timeAgo }
4748 />
4849 </ Button >
4950 ) : (
@@ -54,7 +55,7 @@ export const ResourceStatusCell = ({
5455 design = { isOk ? 'Positive' : 'Negative' }
5556 name = { isOk ? 'sys-enter-2' : 'sys-cancel-2' }
5657 showTooltip = { true }
57- accessibleName = { transitionTime ? formatDateAsTimeAgo ( transitionTime ) : '-' }
58+ accessibleName = { timeAgo }
5859 />
5960 }
6061 text = { isOk ? positiveText : negativeText }
@@ -84,7 +85,7 @@ export const ResourceStatusCell = ({
8485 color : isOk ? 'var(--sapPositiveTextColor)' : 'var(--sapNegativeTextColor)' ,
8586 } }
8687 >
87- { formatDateAsTimeAgo ( transitionTime ) }
88+ { timeAgo }
8889 </ Text >
8990 </ FlexBox >
9091 </ ResponsivePopover >
0 commit comments