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.

Update bounty-list.tsx

Kiran Kac1af1e19956
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-list.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-list.tsx
index c9e0f7d821..8e12be8966 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-list.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-list.tsx
@@ -2,14 +2,14 @@
import useWorkspace from "@/lib/swr/use-workspace";
import { BountyProps } from "@/lib/types";
+import { AnimatedEmptyState } from "@/ui/shared/animated-empty-state";
import { fetcher } from "@dub/utils";
+import { Trophy } from "lucide-react";
import useSWR from "swr";
-import { BountyCard } from "./bounty-card";
+import { BountyCard, BountyCardSkeleton } from "./bounty-card";
// TODO:
-// Fix loading state
// Fix error state
-// Fix no bounties state
export function BountyList() {
const { id: workspaceId, defaultProgramId } = useWorkspace();
@@ -28,23 +28,30 @@ export function BountyList() {
},
);
- if (isLoading) {
- return <></>;
- }
-
if (error) {
return <></>;
}
- if (!bounties || bounties.length === 0) {
- return <></>;
- }
-
- return (
+ return bounties?.length !== 0 || isLoading ? (
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-3">
- {bounties.map((bounty) => (
- <BountyCard key={bounty.id} bounty={bounty} />
- ))}
+ {isLoading
+ ? Array.from({ length: 3 }, (_, index) => (
+ <BountyCardSkeleton key={index} />
+ ))
+ : bounties?.map((bounty) => (
+ <BountyCard key={bounty.id} bounty={bounty} />
+ ))}
</div>
+ ) : (
+ <AnimatedEmptyState
+ title="No bounties found"
+ description="No bounties have been created for this program yet."
+ cardContent={() => (
+ <>
+ <Trophy className="size-4 text-neutral-700" />
+ <div className="h-2.5 w-24 min-w-0 rounded-sm bg-neutral-200" />
+ </>
+ )}
+ />
);
}