Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

ui: display updatedAt on folders and files in data room

Ashish Viradiyae2514c1a7751
diff --git a/components/view/dataroom/document-card.tsx b/components/view/dataroom/document-card.tsx
index 7bcd7619..7e3595cf 100644
--- a/components/view/dataroom/document-card.tsx
+++ b/components/view/dataroom/document-card.tsx
@@ -6,6 +6,7 @@ import { Download, MoreVerticalIcon } from "lucide-react";
import { useTheme } from "next-themes";
import { toast } from "sonner";
+import { timeAgo } from "@/lib/utils";
import { fileIcon } from "@/lib/utils/get-file-icon";
import { Button } from "@/components/ui/button";
@@ -177,6 +178,11 @@ export default function DocumentCard({
</button>
</h2>
</div>
+ <div className="mt-1 flex items-center space-x-1 text-xs leading-5 text-muted-foreground">
+ <p className="truncate">
+ Updated {timeAgo(document.versions[0].updatedAt)}
+ </p>
+ </div>
</div>
</div>
{canDownload && (
diff --git a/components/view/dataroom/folder-card.tsx b/components/view/dataroom/folder-card.tsx
index 85aeed8e..9a2ca0cd 100644
--- a/components/view/dataroom/folder-card.tsx
+++ b/components/view/dataroom/folder-card.tsx
@@ -1,6 +1,8 @@
import { DataroomFolder } from "@prisma/client";
import { FolderIcon } from "lucide-react";
+import { timeAgo } from "@/lib/utils";
+
type FolderCardProps = {
folder: DataroomFolder;
dataroomId: string;
@@ -30,6 +32,9 @@ export default function FolderCard({
</div>
</h2>
</div>
+ <div className="mt-1 flex items-center space-x-1 text-xs leading-5 text-muted-foreground">
+ <p className="truncate">Updated {timeAgo(folder.updatedAt)}</p>
+ </div>
</div>
</div>
</li>
diff --git a/components/view/viewer/dataroom-viewer.tsx b/components/view/viewer/dataroom-viewer.tsx
index 6d334b5c..075bf07c 100644
--- a/components/view/viewer/dataroom-viewer.tsx
+++ b/components/view/viewer/dataroom-viewer.tsx
@@ -42,6 +42,7 @@ export type DocumentVersion = {
versionNumber: number;
hasPages: boolean;
isVertical: boolean;
+ updatedAt: Date;
};
type DataroomDocument = {
@@ -190,7 +191,7 @@ export default function DataroomViewer({
<div className="relative mx-auto flex h-full w-full items-start justify-center">
{/* Tree view */}
<div className="hidden h-full w-1/4 space-y-8 overflow-auto px-3 pb-4 pt-4 md:flex md:px-6 md:pt-6 lg:px-8 lg:pt-9 xl:px-14">
- <ScrollArea showScrollbar>
+ <ScrollArea showScrollbar className="w-full">
<ViewFolderTree
folders={folders}
documents={documents}
diff --git a/lib/api/links/link-data.ts b/lib/api/links/link-data.ts
index 302e30d0..769d0d1c 100644
--- a/lib/api/links/link-data.ts
+++ b/lib/api/links/link-data.ts
@@ -67,6 +67,7 @@ export async function fetchDataroomLinkData({
hasPages: true,
file: true,
isVertical: true,
+ updatedAt: true,
},
take: 1,
},
diff --git a/lib/types.ts b/lib/types.ts
index 737dd149..4f6a721d 100644
--- a/lib/types.ts
+++ b/lib/types.ts
@@ -137,6 +137,7 @@ export interface LinkWithDataroom extends Link {
hasPages: boolean;
file: string;
isVertical: boolean;
+ updatedAt: Date;
}[];
};
}[];