Cleanup pass
This commit is contained in:
@@ -14,9 +14,8 @@ export type GovernanceTemplateCatalogEntry = {
|
||||
/** Path under public/ for getAssetPath() — Figma Asset / Template Mark */
|
||||
iconPath: string;
|
||||
/**
|
||||
* When true, the templates grid shows the “RECOMMENDED” tag (facet-based
|
||||
* scores will set this in `ruleTemplateToGridEntry` when wired; catalog
|
||||
* entries omit unless intentionally static).
|
||||
* When true, static catalog rows show the “RECOMMENDED” tag. Facet-ranked
|
||||
* `/templates` sets this in `gridEntriesWithFacetScores` instead.
|
||||
*/
|
||||
recommended?: boolean;
|
||||
};
|
||||
|
||||
@@ -114,22 +114,6 @@ export function gridEntriesWithFacetScores(
|
||||
const bySlug = (templates: RuleTemplateDto[]) =>
|
||||
new Map(templates.map((t) => [t.slug, t] as const));
|
||||
|
||||
/**
|
||||
* Ordered subset for home: follow `slugOrder`; skip missing slugs.
|
||||
*/
|
||||
export function gridEntriesForSlugOrder(
|
||||
templates: RuleTemplateDto[],
|
||||
slugOrder: readonly string[],
|
||||
): TemplateGridCardEntry[] {
|
||||
const map = bySlug(templates);
|
||||
const out: TemplateGridCardEntry[] = [];
|
||||
for (const slug of slugOrder) {
|
||||
const t = map.get(slug);
|
||||
if (t) out.push(ruleTemplateToGridEntry(t));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Home row: prefer API row per slug; if missing, use static Figma catalog entry.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user