import { createCanvas } from 'canvas';
import fs from 'fs';

// Generate emoji favicon PNGs
const sizes = [
  { name: 'icon-light-32x32.png', size: 32 },
  { name: 'icon-dark-32x32.png', size: 32 },
  { name: 'apple-icon.png', size: 180 },
];

for (const { name, size } of sizes) {
  const canvas = createCanvas(size, size);
  const ctx = canvas.getContext('2d');

  // Transparent background
  ctx.clearRect(0, 0, size, size);

  // Draw emoji
  const fontSize = size * 0.85;
  ctx.font = `${fontSize}px "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif`;
  ctx.textAlign = 'center';
  ctx.textBaseline = 'middle';
  ctx.fillText('🤣', size / 2, size / 2 + size * 0.05);

  // Save
  const buffer = canvas.toBuffer('image/png');
  fs.writeFileSync(`public/${name}`, buffer);
  console.log(`Generated ${name}`);
}
