<x-app-layout>
    @section('title')
        Pages Management
    @endsection
    <!-- Page Heading -->
    <h1 class="h3 mb-2 text-gray-800">
        @can('bank section create')
            <a href="{{ route('admin.banksection.create') }}" class="btn btn-primary"><i class="fas fa-plus"
                    aria-hidden="true"></i>
                Add bank section
            </a>
        @endcan
    </h1>
    <!-- DataTales Example -->
    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <h6 class="m-0 font-weight-bold text-primary">
                How it works
            </h6>
        </div>
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                    <thead>
                        <tr>
                            <th>No</th>
                            <th>title</th>
                            <th>Description</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach ($datas as $key => $data)
                            <tr>
                                <td>{{ $key + 1 }} </td>
                                <td>{{ $data->title }} </td>
                                <td>{{ $data->description }} </td>
                                <td class="d-flex">
                                    <a href="{{ route('admin.banksection.edit', $data->id) }}"
                                        class="btn btn-primary">Edit</a>

                                    <form action="{{ route('admin.banksection.destroy', $data->id) }}" method="POST">
                                        @csrf
                                        @method('delete')
                                        <button class="btn btn-danger">Delete</button>
                                    </form>

                                </td>
                            </tr>
                        @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</x-app-layout>
