Skip to content

Commit

Permalink
fix(structure): do not show revisionDate if not available
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobonamin committed Nov 19, 2024
1 parent 89c8120 commit fa27a83
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,20 @@ export const StatusText = styled(Text)`
export function RevisionStatusLine(): JSX.Element {
const {displayed} = useDocumentPane()
const {t} = useTranslation()
const date = displayed?._updatedAt || displayed?._createdAt

const message = {
name: 'revision',
icon: RestoreIcon,
text: (
text: date ? (
<Translate
t={t}
i18nKey="document-status.revision-from"
values={{
date: format(
new Date(displayed?._updatedAt || displayed?._createdAt || 0),
`MMM d, yyyy '@' pp`,
),
date: format(new Date(date), `MMM d, yyyy '@' pp`),
}}
/>
),
) : null,
tone: 'caution',
}

Expand Down

0 comments on commit fa27a83

Please sign in to comment.