/**
 * Index HTML Generator for React App
 *
 * Generates the HTML entry point for a React SPA
 */

import type { TemplateContext } from '@specverse/types';

export default function generateIndexHtml(context: TemplateContext): string {
  const { spec } = context;

  const appName = spec.metadata?.component || 'SpecVerse App';
  const description = spec.metadata?.description || 'Generated by SpecVerse';

  return `<!DOCTYPE html>
<html lang="en" class="dark">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="${description}" />
    <title>${appName}</title>
  </head>
  <body class="bg-gray-950 text-gray-100">
    <div id="root"></div>
    <script type="module" src="/src/main.tsx"></script>
  </body>
</html>
`;
}
