Skip to content

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

chore: remove unused components

Marc Seitz0a8103437027
diff --git a/components/analytics/recent-views-table.tsx b/components/analytics/recent-views-table.tsx
deleted file mode 100644
index cdd17135..00000000
--- a/components/analytics/recent-views-table.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import { formatDistanceToNow } from "date-fns";
-import { FileText } from "lucide-react";
-
-import BarList from "@/components/ui/bar-list";
-
-export default function RecentViewsTable() {
- // TODO: Replace with actual data fetching
- const views = [
- {
- id: 1,
- documentName: "Q4 2023 Report.pdf",
- viewerName: "John Doe",
- viewerEmail: "[email protected]",
- duration: "2m 30s",
- viewedAt: new Date(Date.now() - 1000 * 60 * 30), // 30 minutes ago
- },
- {
- id: 2,
- documentName: "Product Roadmap.pdf",
- viewerName: "Jane Smith",
- viewerEmail: "[email protected]",
- duration: "4m 15s",
- viewedAt: new Date(Date.now() - 1000 * 60 * 60), // 1 hour ago
- },
- ];
-
- // For the bar visualization, we'll use the duration in seconds
- const getDurationInSeconds = (duration: string) => {
- const [minutes, seconds] = duration.split("m ");
- return parseInt(minutes) * 60 + parseInt(seconds);
- };
-
- const maxDuration = Math.max(
- ...views.map((view) => getDurationInSeconds(view.duration)),
- );
-
- const barListData = views.map((view) => ({
- icon: <FileText className="h-4 w-4 text-muted-foreground" />,
- title: view.documentName,
- subtitle: `${view.viewerName} • ${formatDistanceToNow(view.viewedAt, { addSuffix: true })}`,
- value: getDurationInSeconds(view.duration),
- secondaryValue: view.duration,
- }));
-
- return (
- <div className="space-y-4">
- <BarList
- data={barListData}
- maxValue={maxDuration}
- barBackground="bg-orange-100 dark:bg-orange-950/50"
- />
- </div>
- );
-}
diff --git a/components/analytics/viewers-table.tsx b/components/analytics/viewers-table.tsx
deleted file mode 100644
index 828f6078..00000000
--- a/components/analytics/viewers-table.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
-import BarList from "@/components/ui/bar-list";
-
-export default function ViewersTable() {
- // TODO: Replace with actual data fetching
- const viewers = [
- {
- id: 1,
- name: "John Doe",
- email: "[email protected]",
- viewCount: 15,
- avgDuration: "3m 45s",
- lastActive: new Date(Date.now() - 1000 * 60 * 5), // 5 minutes ago
- },
- {
- id: 2,
- name: "Jane Smith",
- email: "[email protected]",
- viewCount: 8,
- avgDuration: "2m 30s",
- lastActive: new Date(Date.now() - 1000 * 60 * 15), // 15 minutes ago
- },
- ];
-
- const maxViews = Math.max(...viewers.map((viewer) => viewer.viewCount));
-
- const barListData = viewers.map((viewer) => ({
- icon: (
- <Avatar className="h-6 w-6">
- <AvatarImage src={`https://avatar.vercel.sh/${viewer.email}`} />
- <AvatarFallback>{viewer.name.slice(0, 2).toUpperCase()}</AvatarFallback>
- </Avatar>
- ),
- title: viewer.name,
- subtitle: viewer.email,
- value: viewer.viewCount,
- secondaryValue: viewer.avgDuration,
- }));
-
- return (
- <div className="space-y-4">
- <BarList
- data={barListData}
- maxValue={maxViews}
- barBackground="bg-green-100 dark:bg-green-950/50"
- />
- </div>
- );
-}