@props(['activeTab' => 'countries'])

@php
    $tabs = [
        'countries' => [
            'label' => __('geography.tabs.countries'),
            'route' => 'settings.geography.countries.index',
            'permission' => 'geography.view',
        ],
        'regions' => [
            'label' => __('geography.tabs.regions'),
            'route' => 'settings.geography.regions.index',
            'permission' => 'geography.view',
        ],
        'cities' => [
            'label' => __('geography.tabs.cities'),
            'route' => 'settings.geography.cities.index',
            'permission' => 'geography.view',
        ],
    ];
@endphp

<ul class="nav nav-tabs mb-3">
    @foreach ($tabs as $key => $tab)
        @can($tab['permission'])
            <li class="nav-item">
                <a
                    href="{{ route($tab['route']) }}"
                    @class(['nav-link', 'active' => $activeTab === $key])
                >
                    {{ $tab['label'] }}
                </a>
            </li>
        @endcan
    @endforeach
</ul>
