@extends('layouts.admin')

@section('title', 'Pages')

@section('content')
    <section class="dashboard-head">
        <div>
            <span class="eyebrow">Content</span>
            <h1>Pages</h1>
        </div>
    </section>

    @if (session('status'))
        <p class="form-status">{{ session('status') }}</p>
    @endif

    <section class="panel">
        <div class="table-wrap">
            <table>
                <thead>
                    <tr>
                        <th>Page</th>
                        <th>Slug</th>
                        <th>Status</th>
                        <th>Actions</th>
                    </tr>
                </thead>
                <tbody>
                    @forelse ($pages as $page)
                        <tr>
                            <td><strong>{{ $page->title }}</strong></td>
                            <td>{{ $page->slug }}</td>
                            <td><span class="status {{ $page->is_active ? 'paid' : 'refunded' }}">{{ $page->is_active ? 'Active' : 'Inactive' }}</span></td>
                            <td><a class="text-button" href="{{ route('admin.content-pages.edit', $page) }}">Edit</a></td>
                        </tr>
                    @empty
                        <tr><td colspan="4">No pages found.</td></tr>
                    @endforelse
                </tbody>
            </table>
        </div>
    </section>
@endsection
