diff --git a/src/components/bounty-card.tsx b/src/components/bounty-card.tsx index ba1c467..a094bca 100644 --- a/src/components/bounty-card.tsx +++ b/src/components/bounty-card.tsx @@ -4,47 +4,120 @@ type BountyCardProps = { tags: string[]; difficulty: "Easy" | "Medium" | "Hard"; progress: number; + onClick?: () => void; + className?: string; }; const difficultyStyles = { - Easy: "bg-emerald-50 text-emerald-700 border-emerald-200", - Medium: "bg-amber-50 text-amber-700 border-amber-200", - Hard: "bg-rose-50 text-rose-700 border-rose-200", + Easy: { + badge: "bg-emerald-50 text-emerald-700 border-emerald-200", + progress: "bg-emerald-500", + icon: "🌱", + }, + Medium: { + badge: "bg-amber-50 text-amber-700 border-amber-200", + progress: "bg-amber-500", + icon: "⚡", + }, + Hard: { + badge: "bg-rose-50 text-rose-700 border-rose-200", + progress: "bg-rose-500", + icon: "🔥", + }, }; -export function BountyCard({ title, reward, tags, difficulty, progress }: BountyCardProps) { +export function BountyCard({ + title, + reward, + tags, + difficulty, + progress, + onClick, + className = "", +}: BountyCardProps) { + const styles = difficultyStyles[difficulty]; + const isClickable = !!onClick; + return ( -
+
{ + if (isClickable && (e.key === "Enter" || e.key === " ")) { + e.preventDefault(); + onClick(); + } + }} + >
-

{title}

+

+ {title} +

{tags.map((tag) => ( - + {tag} ))}
-
${reward}
- +
+ ${reward.toLocaleString()} +
+ + {styles.icon} {difficulty}
-
-
- Progress - {progress}% + + {/* Progress bar */} +
+
+ + 💰 Funded + + = 100 ? "text-emerald-600" : ""}`}> + {progress >= 100 ? "✓ " : ""}{Math.min(100, progress)}% +
-
+
= 100 ? "animate-pulse" : "" + }`} + style={{ width: `${Math.min(100, progress)}%` }} />
+ + {/* Footer with quick actions */} +
+
+ {progress >= 75 ? "🔥 Almost funded!" : progress >= 50 ? "📈 Halfway there" : "🆕 New opportunity"} +
+ {isClickable && ( +
+ View details + + + +
+ )} +
); }