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

Kiran K1859ed60490a
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/[partnerId]/links/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/[partnerId]/links/page-client.tsx
index 9b7a73fc5d..a6ba3d8a44 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/[partnerId]/links/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/[partnerId]/links/page-client.tsx
@@ -284,9 +284,11 @@ const PartnerDiscountCodes = ({
</div>
<div className="mt-4">
- {!loading &&
- !error &&
- (!discountCodes || discountCodes.length === 0) ? (
+ {loading ? (
+ <div className="flex justify-center py-16">
+ <LoadingSpinner />
+ </div>
+ ) : !error && (!discountCodes || discountCodes.length === 0) ? (
<div className="flex flex-col items-center justify-center gap-2 rounded-lg border border-neutral-200 bg-neutral-50 py-6">
<Tag className="mb-2 size-6 text-neutral-900" />
<h3 className="text-content-emphasis text-sm font-semibold leading-5">
@@ -296,6 +298,12 @@ const PartnerDiscountCodes = ({
Create a discount code for each link
</p>
</div>
+ ) : error ? (
+ <div className="flex justify-center py-16">
+ <span className="text-content-subtle text-sm">
+ Failed to load discount codes
+ </span>
+ </div>
) : (
<Table {...table} />
)}