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-info.tsx

Kiran Ka806df5a9c76
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-info.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-info.tsx
index bdb565b1e7..1f46eeb366 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-info.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-info.tsx
@@ -6,7 +6,18 @@ import { formatDate, pluralize } from "@dub/utils";
import { CalendarDays, Users } from "lucide-react";
export function BountyInfo() {
- const { bounty } = useBounty();
+ const { bounty, loading } = useBounty();
+
+ if (loading) {
+ return null;
+ }
+
+ if (!bounty) {
+ return null;
+ }
+
+ const { pending = 0, approved = 0, rejected = 0 } = bounty.submissions;
+ const totalSubmissions = pending + approved + rejected;
return (
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-6">
@@ -31,19 +42,19 @@ export function BountyInfo() {
</span>
</div>
- {/* <div className="flex items-center space-x-2">
+ <div className="flex items-center space-x-2">
<Users className="size-4 shrink-0" />
<div className="text-sm text-neutral-500">
<span className="font-medium text-neutral-700">
- {bountyStats?.submissions}
+ {totalSubmissions}
</span>{" "}
of{" "}
<span className="font-medium text-neutral-700">
- {bountyStats?.partners}
+ {bounty.partners}
</span>{" "}
- {pluralize("partner", bountyStats?.partners ?? 0)} completed
+ {pluralize("partner", bounty.partners ?? 0)} completed
</div>
- </div> */}
+ </div>
</div>
)}
</div>