From 69ecd4c41733e8e5dc0bfb90eff0612f9712da57 Mon Sep 17 00:00:00 2001 From: BWM0223 Date: Wed, 24 Jun 2026 21:14:48 -0700 Subject: [PATCH] feat: add bounty management navigation and CTA components --- components/bounty/BountyManageNav.tsx | 155 ++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 components/bounty/BountyManageNav.tsx diff --git a/components/bounty/BountyManageNav.tsx b/components/bounty/BountyManageNav.tsx new file mode 100644 index 000000000..9c603c163 --- /dev/null +++ b/components/bounty/BountyManageNav.tsx @@ -0,0 +1,155 @@ +"use client"; + +import Link from "next/link"; +import { usePathname } from "next/navigation"; +import { cn } from "@/lib/utils"; +import { + Settings, + Users, + FileText, + Trophy, + Wallet, + AlertTriangle, + CheckCircle, + BarChart3, +} from "lucide-react"; + +interface BountyManageNavProps { + bountyId: string; + bountyStatus: "draft" | "active" | "submissions" | "judging" | "payout" | "completed" | "cancelled"; + hasDisputes?: boolean; + pendingPayouts?: number; +} + +export function BountyManageNav({ + bountyId, + bountyStatus, + hasDisputes = false, + pendingPayouts = 0, +}: BountyManageNavProps) { + const pathname = usePathname(); + const baseUrl = `/me/bounties/${bountyId}/manage`; + + const navItems = [ + { + label: "Overview", + href: baseUrl, + icon: BarChart3, + enabled: true, + }, + { + label: "Configure", + href: `${baseUrl}/configure`, + icon: Settings, + enabled: ["draft", "active"].includes(bountyStatus), + }, + { + label: "Applications", + href: `${baseUrl}/applications`, + icon: Users, + enabled: true, + badge: bountyStatus === "active" ? "Review" : undefined, + }, + { + label: "Submissions", + href: `${baseUrl}/submissions`, + icon: FileText, + enabled: ["submissions", "judging", "payout", "completed"].includes(bountyStatus), + }, + { + label: "Select Winners", + href: `${baseUrl}/winners`, + icon: Trophy, + enabled: ["judging", "payout"].includes(bountyStatus), + highlight: bountyStatus === "judging", + }, + { + label: "Payout", + href: `${baseUrl}/payout`, + icon: Wallet, + enabled: ["payout", "completed"].includes(bountyStatus), + badge: pendingPayouts > 0 ? `${pendingPayouts} pending` : undefined, + }, + { + label: "Disputes", + href: `${baseUrl}/disputes`, + icon: AlertTriangle, + enabled: true, + badge: hasDisputes ? "Action needed" : undefined, + badgeVariant: hasDisputes ? "destructive" : "default", + }, + { + label: "Results", + href: `${baseUrl}/results`, + icon: CheckCircle, + enabled: bountyStatus === "completed", + }, + ]; + + return ( + + ); +} + +// Management CTA button for the bounty list +export function ManageBountyCTA({ bountyId }: { bountyId: string }) { + return ( + + + Manage + + ); +} + +export default BountyManageNav;