diff --git a/src/components/ageAssurance/AgeAssuranceAccountCard.tsx b/src/components/ageAssurance/AgeAssuranceAccountCard.tsx index 886add3a1b..c0662519d9 100644 --- a/src/components/ageAssurance/AgeAssuranceAccountCard.tsx +++ b/src/components/ageAssurance/AgeAssuranceAccountCard.tsx @@ -2,7 +2,7 @@ import {View} from 'react-native' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' -import {useGetTimeAgo} from '#/lib/hooks/useTimeAgo' +import {dateDiff, useGetTimeAgo} from '#/lib/hooks/useTimeAgo' import {useAgeAssurance} from '#/state/ageAssurance/useAgeAssurance' import {atoms as a, useBreakpoints, useTheme, type ViewStyleProp} from '#/alf' import {Admonition} from '#/components/Admonition' @@ -44,6 +44,9 @@ function Inner({style}: ViewStyleProp & {}) { const timeAgo = lastInitiatedAt ? getTimeAgo(lastInitiatedAt, new Date()) : null + const diff = lastInitiatedAt + ? dateDiff(lastInitiatedAt, new Date(), 'down') + : null return ( <> @@ -96,14 +99,14 @@ function Inner({style}: ViewStyleProp & {}) { a.align_center, gtPhone ? [a.flex_row, a.gap_xl] : [a.gap_md], ]}> - {hasInitiated ? ( + {lastInitiatedAt && timeAgo && diff ? ( - {timeAgo === 'now' ? ( + {diff.value === 0 ? ( Last initiated just now ) : ( Last initiated {timeAgo} ago