Files
at-mintel/packages/meme-generator/src/placeholder.ts
2026-02-21 19:08:06 +01:00

15 lines
507 B
TypeScript

export function getPlaceholderImage(
width: number,
height: number,
text: string,
): string {
// Generate a simple SVG placeholder as base64
const svg = `
<svg width="${width}" height="${height}" xmlns="http://www.w3.org/2000/svg">
<rect width="100%" height="100%" fill="#1e293b"/>
<text x="50%" y="50%" font-family="monospace" font-size="24" fill="#64748b" text-anchor="middle" dy=".3em">${text}</text>
</svg>
`.trim();
return Buffer.from(svg).toString("base64");
}