@extends('admin.layout')

@section('title', 'Website Pages')

@section('content')
    <div class="admin-heading">
        <div>
            <span>Content</span>
            <h1>Website Pages</h1>
        </div>
    </div>

    <section class="admin-card">
        <div class="admin-page-grid">
            @foreach ($slugs as $slug)
                @foreach ($locales as $locale)
                    @php($page = $pages->first(fn ($item) => $item->slug === $slug && $item->locale === $locale))
                    <a href="{{ route('admin.pages.edit', [$slug, $locale]) }}">
                        <strong>{{ ucfirst($slug) }} · {{ strtoupper($locale) }}</strong>
                        <span>{{ $page?->title ?? 'Using default content' }}</span>
                    </a>
                @endforeach
            @endforeach
        </div>
    </section>
@endsection
