<x-admin.layout title="Setup">
    <div class="card">
        <h2>Database Setup</h2>
        @if ($missingTables === [])
            <p class="muted">Semua tabel NusaClouds API Center sudah tersedia.</p>
            <a class="button" href="{{ route('admin.dashboard') }}">Buka Dashboard</a>
        @else
            <p class="muted">Tabel berikut belum ada di database server:</p>
            <ul>
                @foreach ($missingTables as $table)
                    <li><code>{{ $table }}</code></li>
                @endforeach
            </ul>
            <form method="post" action="{{ route('admin.setup.migrate') }}">
                @csrf
                <button type="submit">Run Migration</button>
            </form>
            <p class="muted" style="margin-top:14px">Alternatif via terminal:</p>
            <code>php artisan migrate --force</code>
        @endif

        @if ($output)
            <h2 style="margin-top:18px">Migration Output</h2>
            <pre style="white-space:pre-wrap;background:#0f172a;color:#e2e8f0;border-radius:10px;padding:14px;overflow:auto">{{ $output }}</pre>
        @endif
    </div>
</x-admin.layout>
