import { ICON_FILES } from "yt-dlp-transcript-common/lib/brandIconFiles"; import { iconResponse, renderIconFile } from "yt-dlp-transcript-common/lib/brandIcons"; import { iconPalette } from "../../lib/brand"; // /icons/: the site's icon set, rendered from the one mark at build time // (common/lib/brandIcons.ts). Static: under `output: "export"` each listed file // is written to out/icons/ byte-for-byte, and nothing else resolves. // Never reads the request. export const dynamic = "force-static"; export const dynamicParams = false; export function generateStaticParams() { return ICON_FILES.map((f) => ({ file: f.file })); } export async function GET( _req: Request, { params }: { params: Promise<{ file: string }> }, ) { const { file } = await params; const out = await renderIconFile(file, iconPalette()); if (!out) return new Response("Not found", { status: 404 }); return iconResponse(out.body, out.contentType); }