Initial Commit

This commit is contained in:
Anders Böttcher
2026-05-11 23:39:16 +02:00
parent 9dde8d8804
commit 50566f2a22
38 changed files with 5840 additions and 1015 deletions
+47
View File
@@ -0,0 +1,47 @@
"use client";
import { useRouter } from "next/navigation";
export default function BrowseClient({
groups,
selectedGroup,
}: {
groups: string[];
selectedGroup: string | null;
}) {
const router = useRouter();
function select(g: string | null) {
if (g === null) {
router.push("/browse");
} else {
router.push(`/browse?group=${encodeURIComponent(g)}`);
}
}
return (
<div className="mb-8 flex flex-wrap gap-2">
<button
onClick={() => select(null)}
className={`rounded-full px-4 py-1.5 text-xs font-semibold transition-colors ${selectedGroup === null
? "bg-cyan-500 text-slate-900"
: "border border-slate-700 bg-slate-800/50 text-slate-400 hover:border-slate-500 hover:text-slate-200"
}`}
>
All
</button>
{groups.map((g) => (
<button
key={g}
onClick={() => select(g)}
className={`rounded-full px-4 py-1.5 text-xs font-semibold transition-colors ${selectedGroup === g
? "bg-cyan-500 text-slate-900"
: "border border-slate-700 bg-slate-800/50 text-slate-400 hover:border-slate-500 hover:text-slate-200"
}`}
>
{g}
</button>
))}
</div>
);
}