@extends('layouts.master')
@section('title')
    @lang('translation.regions')
@endsection
@section('content')
    @component('components.breadcrumb')
        @slot('li_1')
            @lang('translation.pages')
        @endslot
        @slot('title')
            @lang('translation.regions')
        @endslot
    @endcomponent
    <div class="row">
        <div class="col-xl-12">
            <div class="card">
                <div class="card-header  border-1">
                    <div class="d-flex align-items-center">
                        <h5 class="card-title mb-0 flex-grow-1">@lang('translation.regions')</h5>
                        <div class="flex-shrink-0 ">
                            <a class="btn btn-ghost-primary bg-primary text-white"
                               href="{{ route('regions.create') }}">  @lang('translation.create-region') </a>
                        </div>
                    </div>
                </div>
                <div class="card-body">
                    <div class="table-responsive ">
                        <table class="table table-borderless table-hover align-middle table-nowrap mb-0">
                            <thead>
                            <tr>
                                <th scope="col">№</th>
                                <th scope="col">@lang('translation.uz')</th>
                                <th scope="col">@lang('translation.ru')</th>
                                <th scope="col">@lang('translation.cr')</th>
                                <th scope="col">@lang('translation.actions')</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach ($regions as $region)
                                <tr>
                                    <td class="fw-medium"> {{$loop->iteration}}</td>
                                    <td>
                                        <a href="{{ route('regions.districts',['id'=>$region->id]) }}">{{  $region->uz }}</a>
                                    </td>
                                    <td>
                                        <a href="{{ route('regions.districts',['id'=>$region->id]) }}">{{  $region->ru }}</a>
                                    </td>
                                    <td>
                                        <a href="{{ route('regions.districts',['id'=>$region->id]) }}">{{  $region->cr }}</a>
                                    </td>
                                    <td>
                                        <div class="hstack gap-3 fs-15">
                                            <a href="{{ route('regions.districts', ['id'=>$region->id]) }}"
                                               title="@lang("translation.view-information")" data-bs-toggle="tooltip"
                                               data-bs-placement="top"
                                               class="link-success">
                                                <i class="ri-eye-line align-middle"></i>
                                            </a>
                                            <a href="{{ route('regions.edit', ['region'=>$region->id]) }}"
                                               title="@lang("translation.edit-information")" data-bs-toggle="tooltip"
                                               data-bs-placement="top"
                                               class="link-warning">
                                                <i class="ri-pencil-line align-middle"></i>
                                            </a>
                                            @component('components.delete-btn')
                                                @slot('url')
                                                    {{ route('regions.destroy', ['region' => $region->id]) }}
                                                @endslot
                                            @endcomponent
                                        </div>
                                    </td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                    </div>
                </div><!-- end card-body -->
            </div><!-- end card -->
        </div><!-- end col -->
    </div>
@endsection
@section('script')
    <script src="{{ URL::asset('/assets/js/app.min.js') }}"></script>
@endsection
