mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-21 00:18:41 +00:00
The docs site renders every component the barrel names, the gallery harvests rules for all of them, and the pages come from the packages rather than a hand-kept copy. Co-authored-by: Hanzo Dev <[email protected]>
21 lines
540 B
TypeScript
21 lines
540 B
TypeScript
import type { LoaderProps } from 'one'
|
|
import { useLoader } from 'one'
|
|
|
|
import { Page } from '~/features/page'
|
|
|
|
export async function generateStaticParams() {
|
|
const { slugs } = await import('~/catalog')
|
|
return slugs()
|
|
.filter((s) => s !== 'index')
|
|
.map((slug) => ({ slug }))
|
|
}
|
|
|
|
export async function loader({ params }: LoaderProps<{ slug: string | string[] }>) {
|
|
const { doc } = await import('~/mdx')
|
|
return doc([params.slug].flat().join('/'))
|
|
}
|
|
|
|
export default function Route() {
|
|
return <Page {...useLoader(loader)} />
|
|
}
|