<?php
function render_header(string $title, string $bodyClass = ''): void
{
    $stylePath = __DIR__ . '/../assets/style.css';
    $fontPath = __DIR__ . '/../assets/font-manrope.css';
    $faPath = __DIR__ . '/../assets/fontawesome/css/all.min.css';
    $appPath = __DIR__ . '/../assets/app.js';

    $styleUrl = asset_url('assets/style.css') . (is_file($stylePath) ? '?v=' . filemtime($stylePath) : '');
    $fontUrl = asset_url('assets/font-manrope.css') . (is_file($fontPath) ? '?v=' . filemtime($fontPath) : '');
    $faUrl = asset_url('assets/fontawesome/css/all.min.css') . (is_file($faPath) ? '?v=' . filemtime($faPath) : '');
    $appUrl = asset_url('assets/app.js') . (is_file($appPath) ? '?v=' . filemtime($appPath) : '');
    ?>
    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title><?= e($title) ?></title>
        <link rel="stylesheet" href="<?= e($styleUrl) ?>">
        <link rel="stylesheet" href="<?= e($fontUrl) ?>">
        <link rel="stylesheet" href="<?= e($faUrl) ?>">
        <script defer src="<?= e($appUrl) ?>"></script>
    </head>
    <body class="<?= e(trim($bodyClass)) ?>">
    <?php
}

function render_footer(): void
{
    ?>
    </body>
    </html>
    <?php
}
