forked from CircuitVerse/community-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReleasesClient.tsx
More file actions
72 lines (65 loc) · 1.54 KB
/
Copy pathReleasesClient.tsx
File metadata and controls
72 lines (65 loc) · 1.54 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
"use client";
import { useState } from "react";
import { Release } from "@/lib/releases";
import { ReleaseCard } from "./ReleaseCard";
export default function ReleasesClient({
releases,
}: {
releases: Release[];
}) {
const [activeRepo, setActiveRepo] =
useState<"Mobile App" | "Vue Simulator">("Mobile App");
const filtered = releases.filter(
(r) => r.repo === activeRepo
);
return (
<div className="mt-6 space-y-6">
{/* Tabs */}
<div
role="tablist"
aria-label="Release repositories"
className="flex gap-6 border-b pb-2"
>
<button
role="tab"
aria-selected={activeRepo === "Mobile App"}
aria-controls="mobile-panel"
onClick={() => setActiveRepo("Mobile App")}
className={
activeRepo === "Mobile App"
? "font-semibold text-[#50B78B]"
: "text-zinc-500"
}
>
Mobile App
</button>
<button
role="tab"
aria-selected={activeRepo === "Vue Simulator"}
aria-controls="vue-panel"
onClick={() => setActiveRepo("Vue Simulator")}
className={
activeRepo === "Vue Simulator"
? "font-semibold text-[#50B78B]"
: "text-zinc-500"
}
>
Vue Simulator
</button>
</div>
{/* Content */}
{filtered.length === 0 ? (
<p className="text-sm text-zinc-500">
No releases yet for {activeRepo}.
</p>
) : (
filtered.map((release) => (
<ReleaseCard
key={`${release.repoSlug}-${release.version}`}
release={release}
/>
))
)}
</div>
);
}