@extends('layouts.master')
@section('content')
    {{-- <div class="container-xxl flex-grow-1 container-p-y">

        <div class="card">
            <h5 class="card-header" style="color:black;">Regions List</h5>
            <div class="table-responsive text-nowrap">
                <table class="table">
                    <thead>
                        <tr class="text-nowrap">
                            <th>#</th>
                            <th>Region Name</th>
                            <th>Created At</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        @if ($result)
                            @foreach ($result as $index => $list)
                                <tr>
                                    <th scope="row">{{ ++$index }}</th>
                                    <td>{{ $list['region'] }}</td>
                                    <td>{{ $list['created_at'] }}</td>
                                    <td><a href="{{ route('cameras.list', [1, $list['_id']]) }}"
                                            class="btn btn-primary btn-sm">Cameras List
                                        </a>
                                        <a href="{{ route('camera.add', [ $list['_id']]) }}"
                                            class="btn btn-success btn-sm">Add New Camera
                                        </a>
                                    </td>

                                </tr>
                            @endforeach
                        @endif

                    </tbody>
                </table>
            </div>

        </div>


        <div class="row" style=" text-align: center; display: block; margin-top: 100px; margin-bottom: 65px; ">
        </div>


    </div>
    </div>
    </div> --}}
    <div class="container-xxl flex-grow-1 container-p-y">

        <div class="card">
            <div class="card-header">
                <h4 class="card-title">Regions List</h4>
            </div>
            <div class="card-body">
                <div class="table-responsive">
                    <table id="example2" class="display" style="width:100%">
                        <thead>
                            <tr class="text-nowrap">
                                <th>#</th>
                                <th>Region Name</th>
                                <th>Created At</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach ($result as $index => $list)
                                <tr>
                                    <td>{{ $loop->iteration }}</td>
                                    <td>{{ $list['region'] }}</td>
                                    <td>{{ $list['created_at'] }}</td>
                                    <td><a href="{{ route('cameras.list', [1, $list['_id']]) }}"
                                            class="btn btn-primary btn-sm">Cameras List
                                        </a>
                                        <a href="{{ route('camera.add', [$list['_id']]) }}"
                                            class="btn btn-success btn-sm">Add
                                            New Camera
                                        </a>
                                    </td>
                                </tr>
                            @endforeach
                        </tbody>
                        <tfoot>
                            <tr>
                                <th>#</th>
                                <th>Region Name</th>
                                <th>Created At</th>
                                <th>Action</th>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>

    <div class="row" style=" text-align: center; display: block; margin-top: 100px; margin-bottom: 65px; ">
    </div>
    </div>
    </div>

@endSection
