content-explorer/ui/components/DataspaceHome.tsx
tegwick d92eb25f92 Map records to generic browser rows.
CONTENT-WP-0002-T03 renders manifest columns through a pure row mapper and replaceable cell renderers.

Assistant: grok
Assistant-Session: 01a1346c-fdff-7741-b1af-b7283661554b
2026-10-13 23:01:09 +02:00

31 lines
1.1 KiB
TypeScript

import { Hero } from "@/components/Hero";
import { RecordBrowser } from "@/components/RecordBrowser";
import { findDataspace, listNavigation } from "@/lib/catalog";
import { notFound } from "next/navigation";
export function DataspaceHome({ id }: { id: string }) {
const dataspace = findDataspace(id);
if (!dataspace) notFound();
const others = listNavigation().filter((item) => item.id !== dataspace.id);
return (
<>
<Hero
dataspace={dataspace.title}
description={dataspace.description}
kinds={dataspace.kinds.map((kind) => ({ href: kind.href, label: kind.plural }))}
/>
{others.length > 0 ? (
<p className="mx-auto max-w-7xl px-4 pt-8 text-sm text-muted sm:px-6">
Other fields:{" "}
{others.map((item, index) => (
<span key={item.id}>
{index > 0 ? ", " : null}
<a className="underline" href={`/${item.id}/`}>{item.title}</a>
</span>
))}
</p>
) : null}
<RecordBrowser rows={dataspace.rows} columns={dataspace.columns} />
</>
);
}