diff --git a/components/hackathon-card.tsx b/components/hackathon-card.tsx index 70b7efb..002a916 100644 --- a/components/hackathon-card.tsx +++ b/components/hackathon-card.tsx @@ -5,7 +5,7 @@ import { Card, CardContent } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Avatar, AvatarFallback } from "@/components/ui/avatar" -import { Trophy, Users, Clock, Vote, Gavel } from "lucide-react" +import { Trophy, Users, Vote, Gavel, Star } from "lucide-react" import { HackathonData, getDaysRemaining, getHackathonStatus } from "@/hooks/useHackathons" import { useChainId } from "wagmi" @@ -14,112 +14,150 @@ interface HackathonCardProps { showJoinButton?: boolean } -export default function HackathonCard({ hackathon, showJoinButton = true }: HackathonCardProps) { - const status = getHackathonStatus(hackathon.startTime, hackathon.endTime, hackathon.concluded) - const daysRemaining = getDaysRemaining(hackathon.endTime) +export default function HackathonCard({ + hackathon, + showJoinButton = true, +}: HackathonCardProps) { + const status = getHackathonStatus( + hackathon.startTime, + hackathon.endTime, + hackathon.concluded + ) const chainId = useChainId() - + + const hackathonUrl = `/h?hackAddr=${hackathon.contractAddress}&chainId=${chainId}` + const getStatusBadge = () => { + const base = "text-white shadow-sm text-xs sm:text-sm" switch (status) { - case 'upcoming': - return Upcoming - case 'accepting-submissions': - return Accepting Submissions - case 'judging-submissions': - return Judging Submissions - case 'concluded': - return Concluded + case "upcoming": + return Upcoming + case "accepting-submissions": + return Accepting Submissions + case "judging-submissions": + return Judging Submissions + case "concluded": + return Concluded default: - return Unknown + return Unknown } } - // Create the URL with hackAddr and chainId parameters - const hackathonUrl = `/h?hackAddr=${hackathon.contractAddress}&chainId=${chainId}` - return ( - + + {/* Image */}
- {hackathon.hackathonName} -
+ +
+ {hackathon.featured && ( + + )} {getStatusBadge()}
- - -
-
-

{hackathon.hackathonName}

-

{hackathon.description || "Web3 Hackathon"}

+ + {/* Content */} + + {/* Title */} +
+

+ {hackathon.hackathonName} +

+

+ {hackathon.description || "Web3 Hackathon"} +

+
+ + {/* Stats */} +
+
+ + + {hackathon.prizePool} ETH +
- -
-
-
- -
- {hackathon.prizePool} ETH -
-
-
- -
- {hackathon.judgeCount} judges -
+ +
+ + + {hackathon.judgeCount} judges +
+
-
-
-
- -
- {hackathon.projectCount} projects -
-
-
- -
- {hackathon.totalTokens} voting tokens -
+
+
+ + + {hackathon.projectCount} projects +
- + +
+ + + {hackathon.totalTokens} voting tokens + +
+
+ + {/* Tags */} + {hackathon.tags?.length > 0 && (
- {(hackathon.tags || []).map((tag) => ( - + {hackathon.tags.map((tag) => ( + {tag} ))}
- -
-
- - - {hackathon.organizer.slice(2, 4).toUpperCase()} - - - - {hackathon.organizer.slice(0, 6)}...{hackathon.organizer.slice(-4)} - -
- - {showJoinButton && ( - - - - )} + )} + + {/* Footer */} +
+
+ + + {hackathon.organizer.slice(2, 4).toUpperCase()} + + + + {hackathon.organizer.slice(0, 6)}…{hackathon.organizer.slice(-4)} +
+ + {showJoinButton && ( + + + + )}
) -} \ No newline at end of file +}