@extends('admin.layout')

@section('title', $title)

@section('body')
<div class="shell">
    @include('admin.partials.sidebar')
    <main class="main">
        <div class="top">
            <h1>{{ $title }}</h1>
            @include('admin.partials.logout')
        </div>
        <table>
            <tr>
                @foreach ($columns as $column)
                    <th>{{ ucwords(str_replace('_', ' ', $column)) }}</th>
                @endforeach
            </tr>
            @foreach ($rows as $row)
                <tr>
                    @foreach ($columns as $column)
                        <td>{{ $row->{$column} ?? '' }}</td>
                    @endforeach
                </tr>
            @endforeach
        </table>
        {{ $rows->links() }}
    </main>
</div>
@endsection
