<?php

declare(strict_types=1);

final class App
{
    public static function view(string $title, string $bodyHtml, array $config): void
    {
        $content = $bodyHtml;
        Layout::render($title, $content, $config);
    }

    public static function card(string $title, string $bodyHtml): string
    {
        ob_start();
        ?>
        <div class="rounded-xl border bg-white p-6">
            <div class="text-base font-semibold"><?= e($title) ?></div>
            <div class="mt-3 text-sm text-slate-700">
                <?= $bodyHtml ?>
            </div>
        </div>
        <?php
        return (string)ob_get_clean();
    }
}
