mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
Replace cross-repo @hanzo/ui/models and @hanzo/zen-models references with self-contained workspace packages @zenlm/ui and @zenlm/models. This eliminates the CI ENOENT failure caused by the file:../../../ui/pkg/ui cross-repo path. - components/ModelTable.tsx: @hanzo/ui/models → @zenlm/ui - components/ZenEnso.tsx: @hanzo/ui/models → @zenlm/ui - app/(home)/ModelLibrary.tsx: @hanzo/ui/models + @hanzo/zen-models → @zenlm/ui + @zenlm/models - app/(home)/page.tsx: @hanzo/zen-models → @zenlm/models - package.json: remove @hanzo/ui, @hanzo/zen-models; add @zenlm/ui, @zenlm/models workspace:*
59 lines
1.4 KiB
TypeScript
59 lines
1.4 KiB
TypeScript
'use client';
|
|
|
|
/**
|
|
* ModelTable for zen-docs MDX pages.
|
|
*
|
|
* Thin wrapper that pulls model data from @zenlm/models (SSOT)
|
|
* and renders with the shared ModelTable component from @zenlm/ui.
|
|
*/
|
|
|
|
import { ModelTable as SharedModelTable } from '@zenlm/ui';
|
|
import { allModels } from '@zenlm/models';
|
|
import type { ZenModel } from '@zenlm/models';
|
|
|
|
interface ModelTableProps {
|
|
/** Explicit ordered list of model IDs to show */
|
|
ids?: string[];
|
|
/** Filter by generation (zen3, zen4, zen5, foundation) */
|
|
generation?: string;
|
|
showParams?: boolean;
|
|
showArch?: boolean;
|
|
showContext?: boolean;
|
|
showPricing?: boolean;
|
|
linkPrefix?: string;
|
|
}
|
|
|
|
export function ModelTable({
|
|
ids,
|
|
generation,
|
|
showParams = true,
|
|
showArch = false,
|
|
showContext = true,
|
|
showPricing = true,
|
|
linkPrefix = '/docs/models/',
|
|
}: ModelTableProps) {
|
|
const byId = new Map(allModels.map((m: ZenModel) => [m.id, m]));
|
|
|
|
let models: ZenModel[];
|
|
if (ids) {
|
|
models = ids.map((id) => byId.get(id)).filter((m): m is ZenModel => m !== undefined);
|
|
} else if (generation) {
|
|
models = allModels.filter((m: ZenModel) => m.generation === generation);
|
|
} else {
|
|
models = allModels;
|
|
}
|
|
|
|
return (
|
|
<SharedModelTable
|
|
models={models}
|
|
linkPrefix={linkPrefix}
|
|
showParams={showParams}
|
|
showArch={showArch}
|
|
showContext={showContext}
|
|
showPricing={showPricing}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default ModelTable;
|