import type * as vscode from "vscode";
import { generateNonce, getScriptTag, getStaticMeta } from "./staticUris";

export function generateWebviewHtml(
  webview: vscode.Webview,
  extensionUri: vscode.Uri,
): string {
  const nonce = generateNonce();

  return /*html*/ `
    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        ${getStaticMeta(webview, extensionUri, nonce)}
        <title>Codeflash</title>
      </head>
      <body>
        <div id="root"></div>
        ${getScriptTag(webview, extensionUri, nonce)}
      </body>
    </html>
  `;
}
