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.

Add `MiniAreaChart`s

Tim Wilson4bbb76c8e4d5
diff --git a/apps/web/app/app.dub.co/embed/activity.tsx b/apps/web/app/app.dub.co/embed/activity.tsx
index 0ca76ac4e8..fa5cc5ca6e 100644
--- a/apps/web/app/app.dub.co/embed/activity.tsx
+++ b/apps/web/app/app.dub.co/embed/activity.tsx
@@ -1,5 +1,13 @@
-import { InfoTooltip } from "@dub/ui";
+import { InfoTooltip, MiniAreaChart } from "@dub/ui";
import { nFormatter } from "@dub/utils";
+import { subDays } from "date-fns";
+
+const TMP_CHART_DATA = [...Array(30)]
+ .map((_, i) => ({
+ date: subDays(new Date(), i),
+ value: Math.floor(Math.random() * 100 * (30 - i)),
+ }))
+ .reverse();
export function EmbedActivity({
clicks,
@@ -29,17 +37,19 @@ export function EmbedActivity({
description: "Total number of leads that converted to a paid account",
},
].map(({ label, value, description }) => (
- <div
- key={label}
- className="relative flex flex-col justify-between gap-4 p-4"
- >
- <span className="flex items-center gap-1 text-sm text-neutral-500">
- {label}
- <InfoTooltip content={description} />
- </span>
- <span className="text-lg font-semibold text-neutral-700">
- {nFormatter(value, { full: true })}
- </span>
+ <div key={label} className="relative flex flex-col justify-between p-4">
+ <div>
+ <span className="flex items-center gap-1 text-sm text-neutral-500">
+ {label}
+ <InfoTooltip content={description} />
+ </span>
+ <span className="text-base font-medium leading-none text-neutral-700">
+ {nFormatter(value, { full: true })}
+ </span>
+ </div>
+ <div className="xs:block hidden h-12">
+ <MiniAreaChart data={TMP_CHART_DATA} />
+ </div>
</div>
))}
</div>