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

Tim Wilsond5619f290dc9
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/marketplace-empty-state.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/marketplace-empty-state.tsx
new file mode 100644
index 0000000000..d41f807ce8
--- /dev/null
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/marketplace-empty-state.tsx
@@ -0,0 +1,51 @@
+import { AnimatedEmptyState } from "@/ui/shared/animated-empty-state";
+import { Button } from "@dub/ui";
+
+export function MarketplaceEmptyState({
+ isFiltered,
+ onClearAllFilters,
+}: {
+ isFiltered: boolean;
+ onClearAllFilters: () => void;
+}) {
+ return (
+ <AnimatedEmptyState
+ title="No programs found"
+ description={
+ isFiltered ? (
+ <>
+ Press{" "}
+ <span className="text-content-default bg-bg-emphasis rounded-md px-1 py-0.5 text-xs font-semibold">
+ Esc
+ </span>{" "}
+ to clear all filters.
+ </>
+ ) : (
+ "There are no programs for you to discover yet."
+ )
+ }
+ className="border-none md:min-h-[400px]"
+ cardClassName="py-3"
+ cardCount={2}
+ cardContent={() => (
+ <div className="flex grow items-center gap-4">
+ <div className="size-9 shrink-0 rounded-full bg-neutral-200" />
+ <div className="flex grow flex-col gap-2">
+ <div className="h-2.5 w-full min-w-0 rounded bg-neutral-200" />
+ <div className="h-2.5 w-12 min-w-0 rounded bg-neutral-200" />
+ </div>
+ </div>
+ )}
+ addButton={
+ isFiltered ? (
+ <Button
+ type="button"
+ text="Clear all filters"
+ className="h-9 rounded-lg"
+ onClick={onClearAllFilters}
+ />
+ ) : undefined
+ }
+ />
+ );
+}
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/page-client.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/page-client.tsx
index 6a2d45bc2b..6206e12ecf 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/page-client.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/page-client.tsx
@@ -5,6 +5,7 @@ import { NetworkProgramProps } from "@/lib/types";
import { Link4, useRouterStuff } from "@dub/ui";
import { OG_AVATAR_URL, cn, fetcher, getPrettyUrl } from "@dub/utils";
import useSWR from "swr";
+import { MarketplaceEmptyState } from "./marketplace-empty-state";
export function ProgramMarketplacePageClient() {
const { searchParams, getQueryString, queryParams } = useRouterStuff();
@@ -82,8 +83,10 @@ export function ProgramMarketplacePageClient() {
</div> */}
</div>
) : (
- // TODO: Empty state
- <p>No programs found</p>
+ <MarketplaceEmptyState
+ isFiltered={false} // TODO
+ onClearAllFilters={() => {}} // TODO
+ />
)}
</div>
);