Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

improve events table

Steven Tey653efbcde957
diff --git a/apps/web/ui/analytics/events/events-table.tsx b/apps/web/ui/analytics/events/events-table.tsx
index d9fb816d3f..aee404a7fc 100644
--- a/apps/web/ui/analytics/events/events-table.tsx
+++ b/apps/web/ui/analytics/events/events-table.tsx
@@ -7,6 +7,8 @@ import { leadEventResponseSchema } from "@/lib/zod/schemas/leads";
import { saleEventResponseSchema } from "@/lib/zod/schemas/sales";
import EmptyState from "@/ui/shared/empty-state";
import {
+ Avatar,
+ CopyButton,
LinkLogo,
Table,
Tooltip,
@@ -178,14 +180,41 @@ export default function EventsTable() {
const customer = getValue();
const display = customer.name || customer.email || "Unknown";
return (
- <div className="flex items-center gap-3" title={display}>
- <img
- alt={display}
- src={customer.avatar}
- className="size-4 shrink-0 rounded-full border border-gray-200"
- />
- <span className="truncate">{display}</span>
- </div>
+ <Tooltip
+ content={
+ <div className="w-full p-3">
+ <Avatar
+ user={{
+ name: customer.name,
+ email: customer.email,
+ image: customer.avatar,
+ }}
+ className="h-8 w-8"
+ />
+ <p className="mt-2 text-sm font-semibold text-gray-700">
+ {customer?.name || customer?.email || "Anonymous User"}
+ </p>
+ <div className="flex items-center gap-1 text-xs text-gray-500">
+ <p>{customer.email}</p>
+ <CopyButton
+ value={customer.email}
+ variant="neutral"
+ className="p-1 [&>*]:h-3 [&>*]:w-3"
+ successMessage="Copied email to clipboard!"
+ />
+ </div>
+ </div>
+ }
+ >
+ <div className="flex items-center gap-3" title={display}>
+ <img
+ alt={display}
+ src={customer.avatar}
+ className="size-4 shrink-0 rounded-full border border-gray-200"
+ />
+ <span className="truncate">{display}</span>
+ </div>
+ </Tooltip>
);
},
},
diff --git a/packages/ui/src/copy-button.tsx b/packages/ui/src/copy-button.tsx
index 6da7c8b2dd..57f7a4840f 100644
--- a/packages/ui/src/copy-button.tsx
+++ b/packages/ui/src/copy-button.tsx
@@ -28,10 +28,12 @@ export function CopyButton({
value,
className,
icon,
+ successMessage,
}: {
value: string;
className?: string;
icon?: LucideIcon;
+ successMessage?: string;
} & VariantProps<typeof copyButtonVariants>) {
const [copied, setCopied] = useState(false);
const Comp = icon || Copy;
@@ -41,7 +43,7 @@ export function CopyButton({
e.stopPropagation();
setCopied(true);
navigator.clipboard.writeText(value).then(() => {
- toast.success("Copied to clipboard!");
+ toast.success(successMessage || "Copied to clipboard!");
});
setTimeout(() => setCopied(false), 3000);
}}