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 loading state

Steven Tey6823dfcea99f
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/analytics/analytics-partners-table.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/analytics/analytics-partners-table.tsx
index 2ca44c331b..a8871be89c 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/analytics/analytics-partners-table.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/analytics/analytics-partners-table.tsx
@@ -15,58 +15,6 @@ import {
import { useContext, useMemo } from "react";
import useSWR from "swr";
-function PartnerTableSkeleton() {
- return (
- <div className="bg-bg-default relative overflow-x-auto rounded-xl">
- <table className="group/table w-full border-separate border-spacing-0 text-sm transition-[border-spacing,margin-top] [&_tr:last-child>td]:border-b-transparent [&_tr>*:first-child]:border-l-transparent [&_tr>*:last-child]:border-r-transparent [&_tr]:border-b">
- <thead>
- <tr>
- <th className="border-border-subtle border-b border-l-0 px-4 py-2.5 text-left font-medium text-neutral-900">
- Partner
- </th>
- <th className="border-border-subtle border-b border-l-0 px-4 py-2.5 text-left font-medium text-neutral-900">
- Clicks
- </th>
- <th className="border-border-subtle border-b border-l-0 px-4 py-2.5 text-left font-medium text-neutral-900">
- Leads
- </th>
- <th className="border-border-subtle border-b border-l-0 px-4 py-2.5 text-left font-medium text-neutral-900">
- Sales
- </th>
- <th className="border-border-subtle border-b border-l-0 px-4 py-2.5 text-left font-medium text-neutral-900">
- Revenue
- </th>
- </tr>
- </thead>
- <tbody>
- {[...Array(10)].map((_, idx) => (
- <tr key={idx} className="group/row">
- <td className="border-border-subtle border-b border-l-0 px-4 py-2.5">
- <div className="flex items-center gap-2.5">
- <div className="size-6 animate-pulse rounded-full bg-neutral-200" />
- <div className="h-4 w-32 animate-pulse rounded bg-neutral-200" />
- </div>
- </td>
- <td className="border-border-subtle border-b border-l-0 px-4 py-2.5">
- <div className="h-4 w-16 animate-pulse rounded bg-neutral-200" />
- </td>
- <td className="border-border-subtle border-b border-l-0 px-4 py-2.5">
- <div className="h-4 w-16 animate-pulse rounded bg-neutral-200" />
- </td>
- <td className="border-border-subtle border-b border-l-0 px-4 py-2.5">
- <div className="h-4 w-16 animate-pulse rounded bg-neutral-200" />
- </td>
- <td className="border-border-subtle border-b border-l-0 px-4 py-2.5">
- <div className="h-4 w-20 animate-pulse rounded bg-neutral-200" />
- </td>
- </tr>
- ))}
- </tbody>
- </table>
- </div>
- );
-}
-
export function AnalyticsPartnersTable() {
const { selectedTab, queryString } = useContext(AnalyticsContext);
@@ -212,3 +160,56 @@ export function AnalyticsPartnersTable() {
</div>
);
}
+
+function PartnerTableSkeleton() {
+ const { selectedTab } = useContext(AnalyticsContext);
+ return (
+ <div className="bg-bg-default relative overflow-x-auto rounded-xl">
+ <table className="group/table w-full border-separate border-spacing-0 text-sm transition-[border-spacing,margin-top] [&_tr:last-child>td]:border-b-transparent [&_tr>*:first-child]:border-l-transparent [&_tr>*:last-child]:border-r-transparent [&_tr]:border-b">
+ <thead>
+ <tr>
+ <th className="border-border-subtle border-b border-l-0 px-4 py-2.5 text-left font-medium text-neutral-900">
+ Partner
+ </th>
+ <th className="border-border-subtle border-b border-l-0 px-4 py-2.5 text-left font-medium text-neutral-900">
+ Location
+ </th>
+ <th className="border-border-subtle border-b border-l-0 px-4 py-2.5 text-left font-medium text-neutral-900">
+ {capitalize(selectedTab)}
+ </th>
+ {selectedTab === "sales" && (
+ <>
+ <th className="border-border-subtle border-b border-l-0 px-4 py-2.5 text-left font-medium text-neutral-900">
+ Revenue
+ </th>
+ </>
+ )}
+ </tr>
+ </thead>
+ <tbody>
+ {[...Array(10)].map((_, idx) => (
+ <tr key={idx} className="group/row">
+ <td className="border-border-subtle border-b border-l-0 px-4 py-2.5">
+ <div className="flex items-center gap-2.5">
+ <div className="size-6 animate-pulse rounded-full bg-neutral-200" />
+ <div className="h-4 w-32 animate-pulse rounded bg-neutral-200" />
+ </div>
+ </td>
+ <td className="border-border-subtle border-b border-l-0 px-4 py-2.5">
+ <div className="h-4 w-20 animate-pulse rounded bg-neutral-200" />
+ </td>
+ <td className="border-border-subtle border-b border-l-0 px-4 py-2.5">
+ <div className="h-4 w-20 animate-pulse rounded bg-neutral-200" />
+ </td>
+ {selectedTab === "sales" && (
+ <td className="border-border-subtle border-b border-l-0 px-4 py-2.5">
+ <div className="h-4 w-20 animate-pulse rounded bg-neutral-200" />
+ </td>
+ )}
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ </div>
+ );
+}