From 2840ea0f387878c56f2da3dc4c1577e1d85a15b2 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 2 Jan 2026 18:41:54 +0200 Subject: [PATCH] chore(revisions): display a message when a preview is not available --- apps/client/src/widgets/dialogs/revisions.tsx | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/apps/client/src/widgets/dialogs/revisions.tsx b/apps/client/src/widgets/dialogs/revisions.tsx index 2d13d3d82..5d73230dd 100644 --- a/apps/client/src/widgets/dialogs/revisions.tsx +++ b/apps/client/src/widgets/dialogs/revisions.tsx @@ -264,24 +264,7 @@ function RevisionContent({ noteContent, revisionItem, fullRevision, showDiff }: } } case "file": - return - - - - - - - - - {fullRevision.content && - - - - } -
{t("revisions.mime")}{revisionItem.mime}
{t("revisions.file_size")}{revisionItem.contentLength && utils.formatSize(revisionItem.contentLength)}
- {t("revisions.preview")} -
{fullRevision.content}
-
; + return ; case "canvas": case "mindMap": case "mermaid": { @@ -374,6 +357,31 @@ function RevisionFooter({ note }: { note?: FNote }) { ; } +function FilePreview({ revisionItem, fullRevision }: { revisionItem: RevisionItem, fullRevision: RevisionPojo }) { + return ( + + + + + + + + + + + + + + +
{t("revisions.mime")}{revisionItem.mime}
{t("revisions.file_size")}{revisionItem.contentLength && utils.formatSize(revisionItem.contentLength)}
+ {t("revisions.preview")} + {fullRevision.content + ?
{fullRevision.content}
+ :
{t("revisions.preview_not_available")}
} +
+ ); +} + async function getNote(noteId?: string | null) { if (noteId) { return await froca.getNote(noteId);