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.

fix ts

Steven Tey3dd17bad2371
diff --git a/apps/web/ui/analytics/events/events-table.tsx b/apps/web/ui/analytics/events/events-table.tsx
index eb71272c3f..d5a9757e18 100644
--- a/apps/web/ui/analytics/events/events-table.tsx
+++ b/apps/web/ui/analytics/events/events-table.tsx
@@ -408,8 +408,6 @@ export default function EventsTable() {
[tab],
);
- const defaultData = useMemo(() => [], []);
-
const { pagination, setPagination } = usePagination();
const { queryString: originalQueryString, totalEvents } =
@@ -456,7 +454,7 @@ export default function EventsTable() {
);
const { table, ...tableProps } = useTable({
- data: data ?? (needsHigherPlan ? exampleData[tab] : defaultData),
+ data: (data ?? (needsHigherPlan ? exampleData[tab] : [])) as EventDatum[],
loading: isLoading,
error: error && !needsHigherPlan ? "Failed to fetch events." : undefined,
columns,
diff --git a/apps/web/ui/analytics/events/example-data.ts b/apps/web/ui/analytics/events/example-data.ts
index a2bbca3b16..8034d63ec1 100644
--- a/apps/web/ui/analytics/events/example-data.ts
+++ b/apps/web/ui/analytics/events/example-data.ts
@@ -70,6 +70,7 @@ export const exampleData = {
clicks: [
{
...common,
+ event: "click",
timestamp: "2024-06-09T16:12:02.556Z",
click_id: "1",
continent: "NA",
@@ -79,6 +80,7 @@ export const exampleData = {
},
{
...common,
+ event: "click",
timestamp: "2024-06-09T15:52:02.556Z",
click_id: "2",
continent: "NA",
@@ -88,6 +90,7 @@ export const exampleData = {
},
{
...common,
+ event: "click",
timestamp: "2024-06-08T13:32:02.556Z",
click_id: "3",
continent: "NA",
@@ -99,6 +102,7 @@ export const exampleData = {
leads: [
{
...common,
+ event: "lead",
click_id: "1",
timestamp: "2024-06-11T17:03:56.000Z",
event_id: "YbL8RwLTRRCxQz5H",
@@ -111,6 +115,7 @@ export const exampleData = {
},
{
...common,
+ event: "lead",
click_id: "2",
timestamp: "2024-06-10T16:07:56.000Z",
event_id: "YbL8RwLTRRCxQz5H",
@@ -123,6 +128,7 @@ export const exampleData = {
},
{
...common,
+ event: "lead",
click_id: "3",
timestamp: "2024-06-10T16:07:56.000Z",
event_id: "YbL8RwLTRRCxQz5H",
@@ -137,6 +143,7 @@ export const exampleData = {
sales: [
{
...common,
+ event: "sale",
click_id: "1",
timestamp: "2024-06-14T18:36:01.000Z",
event_id: "Nffk2cwShKu5lQ7E",
@@ -152,6 +159,7 @@ export const exampleData = {
},
{
...common,
+ event: "sale",
click_id: "2",
timestamp: "2024-06-13T20:36:06.000Z",
event_id: "Nffk2cwShKu5lQ7E",
@@ -167,6 +175,7 @@ export const exampleData = {
},
{
...common,
+ event: "sale",
click_id: "2",
timestamp: "2024-06-13T22:02:06.000Z",
event_id: "Nffk2cwShKu5lQ7E",