SPB Git

Repository Public MIT

page.tsx 1.6 KB 37 lines tsx

1import type { Metadata } from "next";2import Link from "next/link";3import { EmptyState } from "@/components/artifact-card";4import { plural } from "@/lib/format";5import { publicCtx } from "@/lib/session";6import { listCollections } from "@/server/community";78export const metadata: Metadata = { title: "Collections", description: "Curated collections of agent capabilities for research and engineering." };910export default async function Page() {11  const collections = await listCollections(await publicCtx());12  return (13    <div className="container-page pb-10 pt-12">14      <header className="mb-8 max-w-3xl">15        <p className="eyebrow mb-3">Curated</p>16        <h1 className="text-3xl font-semibold tracking-tight sm:text-4xl">Collections</h1>17        <p className="mt-3 text-muted">Hand-curated groupings of public artifacts. A collection can be empty: items are added only after review, never to make a page look full.</p>18      </header>19      {collections.length === 0 ? (20        <EmptyState title="No collections yet." />21      ) : (22        <ul className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">23          {collections.map((c) => (24            <li key={c.slug}>25              <Link href={`/collections/${c.slug}`} className="card card-hover flex h-full flex-col p-6">26                <h2 className="text-base font-medium">{c.title}</h2>27                <p className="mt-2 flex-1 text-sm text-muted">{c.description}</p>28                <p className="mt-4 font-mono text-[11px] text-faint">{plural(c.item_count, "artifact")}</p>29              </Link>30            </li>31          ))}32        </ul>33      )}34    </div>35  );36}37
Files main
Menu

Theme