Skip to content

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

feat: add dataroom view count

Marc Seitz547c2c144607
diff --git a/lib/swr/use-datarooms.ts b/lib/swr/use-datarooms.ts
index 991b7797..191166bb 100644
--- a/lib/swr/use-datarooms.ts
+++ b/lib/swr/use-datarooms.ts
@@ -6,6 +6,7 @@ import { Dataroom } from "@prisma/client";
export type DataroomWithCount = Dataroom & {
_count: {
documents: number;
+ views: number;
};
};
diff --git a/pages/datarooms/index.tsx b/pages/datarooms/index.tsx
index ae3311ea..fbf4c49c 100644
--- a/pages/datarooms/index.tsx
+++ b/pages/datarooms/index.tsx
@@ -106,6 +106,16 @@ export default function DataroomsPage() {
</div>
</dd>
</div>
+ <div className="flex justify-between gap-x-4 py-3">
+ <dt className="text-gray-500 dark:text-gray-400">
+ Views
+ </dt>
+ <dd className="flex items-start gap-x-2">
+ <div className="font-medium text-gray-900 dark:text-gray-200">
+ {dataroom._count.views ?? 0}
+ </div>
+ </dd>
+ </div>
</dl>
</CardContent>
</Card>