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 no links state

Kiran K4021b9008a84
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/links/page-client.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/links/page-client.tsx
index 5ee12c4e56..53e1ce351c 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/links/page-client.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/links/page-client.tsx
@@ -8,9 +8,11 @@ import { IntervalOptions } from "@/lib/analytics/types";
import usePartnerLinks from "@/lib/swr/use-partner-links";
import useProgramEnrollment from "@/lib/swr/use-program-enrollment";
import { usePartnerLinkModal } from "@/ui/modals/partner-link-modal";
+import { AnimatedEmptyState } from "@/ui/shared/animated-empty-state";
import SimpleDateRangePicker from "@/ui/shared/simple-date-range-picker";
import { Button, CardList, useKeyboardShortcut, useRouterStuff } from "@dub/ui";
import { ChartTooltipSync } from "@dub/ui/charts";
+import { CursorRays, Hyperlink } from "@dub/ui/icons";
import { useParams } from "next/navigation";
import { createContext, useContext, useMemo } from "react";
import { PartnerLinkCard } from "./partner-link-card";
@@ -101,6 +103,27 @@ export function ProgramLinksPageClient() {
</div>
) : loading ? (
<LinkCardSkeleton />
+ ) : links?.length === 0 ? (
+ <AnimatedEmptyState
+ title="No links yet"
+ description="Get started by creating your first partner link to track your referrals."
+ cardContent={
+ <>
+ <Hyperlink className="size-4 text-neutral-700" />
+ <div className="h-2.5 w-24 min-w-0 rounded-sm bg-neutral-200" />
+ <div className="xs:flex hidden grow items-center justify-end gap-1.5 text-neutral-500">
+ <CursorRays className="size-3.5" />
+ </div>
+ </>
+ }
+ addButton={
+ <Button
+ text="Create Link"
+ onClick={() => setShowPartnerLinkModal(true)}
+ shortcut="C"
+ />
+ }
+ />
) : (
links?.map((link) => (
<PartnerLinkCard