Skip to content

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

Add expired indicator to link table with timestamp tooltip

Cursor Agent6c7632e1e810
diff --git a/components/links/links-table.tsx b/components/links/links-table.tsx
index 42a61624..3618ad55 100644
--- a/components/links/links-table.tsx
+++ b/components/links/links-table.tsx
@@ -10,6 +10,7 @@ import { DocumentVersion, LinkAudienceType } from "@prisma/client";
import { isWithinInterval, subMinutes } from "date-fns";
import {
BoxesIcon,
+ ClockIcon,
Code2Icon,
CopyPlusIcon,
EyeIcon,
@@ -674,6 +675,19 @@ export default function LinksTable({
Updated
</Badge>
)}
+ {link.expiresAt &&
+ new Date(link.expiresAt) < new Date() && (
+ <TimestampTooltip
+ timestamp={link.expiresAt}
+ side="right"
+ rows={["local", "utc"]}
+ >
+ <span className="flex cursor-default items-center gap-1 rounded-full bg-destructive/10 px-2 py-0.5 text-xs text-destructive ring-1 ring-destructive/20">
+ <ClockIcon className="h-3 w-3" />
+ Expired
+ </span>
+ </TimestampTooltip>
+ )}
{link.domainId && isFree ? (
<span className="ml-2 rounded-full bg-destructive px-2.5 py-0.5 text-xs text-foreground ring-1 ring-destructive">
Inactive