<?php

declare(strict_types=1);

final class LoadingSpinner
{
    public static function render(string $label = 'Loading...'): string
    {
        ob_start();
        ?>
        <div class="flex items-center gap-2 text-sm text-slate-600">
            <div class="h-4 w-4 animate-spin rounded-full border-2 border-slate-300 border-t-slate-900"></div>
            <span><?= e($label) ?></span>
        </div>
        <?php
        return (string)ob_get_clean();
    }
}
