Add registry kind indexes and entity pages.
CONTENT-WP-0002-T02 reads kinds from each snapshot and serves both example dataspaces without oncology imports. Assistant: grok Assistant-Session: 01a1346c-fdff-7741-b1af-b7283661554b
This commit is contained in:
parent
a6e360aaa5
commit
e16aa03393
21 changed files with 608 additions and 59 deletions
31
ui/components/DataspaceHome.tsx
Normal file
31
ui/components/DataspaceHome.tsx
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
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} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue