forked from naman79820/circuitverse-leaderboard
-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathReleaseCard.tsx
More file actions
76 lines (70 loc) · 2.51 KB
/
Copy pathReleaseCard.tsx
File metadata and controls
76 lines (70 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { Release } from "@/lib/releases";
import Link from "next/link";
import { Card, CardContent } from "@/components/ui/card";
import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";
import { cn } from "@/lib/utils";
export function ReleaseCard({ release }: { release: Release }) {
return (
<Card className="transition-all hover:shadow-md hover:border-[#50B78B]/50">
<CardContent className="p-5 space-y-4">
{/* Header */}
<div className="flex flex-col sm:flex-row sm:items-start sm:justify-between gap-2 sm:gap-4">
<div className="min-w-0">
<h3 className="text-base sm:text-lg font-semibold break-words">
{release.repo} — {release.version}
</h3>
<p className="text-sm text-muted-foreground break-words">
{release.summary}
</p>
</div>
<span className="text-xs sm:text-sm text-zinc-500 whitespace-normal sm:whitespace-nowrap sm:self-start">
{release.date}
</span>
</div>
{/* Contributors */}
{release.contributors.length > 0 && (
<div className="flex flex-wrap gap-2 pt-2">
{release.contributors.map((c) => (
<Link
key={c.username}
href={`https://github.com/${c.username}`}
target="_blank"
rel="noopener noreferrer"
className={cn(
"flex items-center gap-2 px-3 py-1.5 rounded-full",
"bg-[#50B78B]/10 hover:bg-[#50B78B]/20 transition"
)}
>
<Avatar className="h-7 w-7">
<AvatarImage
src={`https://github.com/${c.username}.png`}
alt={c.username}
/>
<AvatarFallback className="text-xs">
{c.username.substring(0, 2).toUpperCase()}
</AvatarFallback>
</Avatar>
<span className="text-sm font-medium text-[#50B78B]">
@{c.username}
</span>
</Link>
))}
</div>
)}
{/* GitHub link */}
{release.githubUrl && (
<div className="pt-2">
<Link
href={release.githubUrl}
target="_blank"
rel="noopener noreferrer"
className="text-sm text-muted-foreground hover:text-[#50B78B] transition"
>
View on GitHub →
</Link>
</div>
)}
</CardContent>
</Card>
);
}