@extends('layouts.app')

@section('title', __('{{ key }}::messages.title'))

@section('content')
    <x-page-header :title="__('{{ key }}::messages.title')">
        @can('create', \Modules\{{ Module }}\Models\{{ Entity }}::class)
            <a href="{{ route('{{ key }}.create') }}" class="btn px-btn-primary d-inline-flex align-items-center gap-2">
                <i class="bi bi-plus-lg"></i> {{ __('common.create') }}
            </a>
        @endcan
    </x-page-header>

    <div class="px-panel p-3 p-md-4">
        @forelse ($records as $record)
            <div class="px-entry py-2 border-bottom">
                <a href="{{ route('{{ key }}.show', $record) }}">{{ $record->name }}</a>
            </div>
        @empty
            <div class="px-empty py-4">
                <div class="px-empty__art" aria-hidden="true">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"
                         stroke-linecap="round" stroke-linejoin="round">
                        <path d="M5 4h11l3 3v13H5z" /><path d="M9 12h6M9 16h4" />
                    </svg>
                </div>

                <p class="px-empty__title">{{ __('{{ key }}::messages.empty') }}</p>
                <p class="px-empty__text mb-0">{{ __('{{ key }}::messages.empty_text') }}</p>
            </div>
        @endforelse

        {{ $records->links() }}
    </div>
@endsection
