import { escapeHtml } from "../utils/html";

interface LayoutProps {
    title: string;
    content: string;
}

export function BaseLayout({ title, content }: LayoutProps): string {
    const safeTitle = escapeHtml(title);
    return `<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>${safeTitle} | Aurora</title>
    <link rel="stylesheet" href="/style.css">
    <meta name="description" content="Aurora Bot Web Interface">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;600;700&display=swap" rel="stylesheet">
</head>
<body>
    <header>
        <h1>Aurora Web</h1>
        <nav>
            <a href="/">Home</a>
        </nav>
    </header>
    <main>
        ${content}
    </main>
    <footer>
        <p>&copy; ${new Date().getFullYear()} Aurora Bot</p>
    </footer>
    <script src="/script.js" defer></script>
</body>
</html>`;
}
