Files
Portfolio/src/lib/route-plate.ts

16 lines
575 B
TypeScript

import type { PublicProject } from '@/content/types';
/**
* Decorative registration plate for a project, e.g. "05.1 / PRIVATE / ACTIVE".
* Built only from real content fields; rendered through CSS generated content.
*/
export function routePlate(
exit: string | undefined,
index: number,
project: Pick<PublicProject, 'visibility' | 'maturity'>,
): string {
const code = exit === undefined ? `${index + 1}` : `${exit}.${index + 1}`;
const maturity = project.maturity.replace(/-/gu, ' ');
return `${code} / ${project.visibility} / ${maturity}`.toUpperCase();
}