@extends('layouts.config_dashboard.app')

@section('content')
    <div class="container-fluid mt-4">
        <div class="row">
            <div class="col-12">
                <div class="card">
                    <div class="card-body">
                        <div class="row mb-3">
                            <div class="d-flex ">
                                <div class="col-md-6">
                                    <a style="float: left" href="{{ route('TypeRendezVous.create') }}"
                                        class="btn btn-success rounded-pill"> Créer</a>
                                </div>
                                {{-- <div class="col-md-6">
                                    <a style="float: right" href="{{ route('TypeRendezVous.deleted') }}"
                                        class="btn btn-warning rounded-pill"> Restaurer</a>
                                </div> --}}
                            </div>
                        </div>
                        <div class="table-responsive">
                            <table class="table" id="myTable">
                                <thead>
                                    <tr>
                                        <th>Id</th>
                                        <th>Type Rendez Vous</th>
                                        <th>Direction</th>
                                        <th>Modifier</th>
                                        {{-- <th>Delete</th> --}}
                                    </tr>
                                </thead>
                                <tbody>
                                    @forelse ($types as $type)
                                        <tr>
                                            <td>{{ $type->id }}</td>
                                            <td>{{ $type->type }}</td>
                                            <td>
                                                @if ($type->for_direction)
                                                OUI
                                                @else
                                                NON
                                                @endif
                                            </td>
                                            <td> <a class="btn btn-sm btn-primary rounded-pill"
                                                    href="{{ route('TypeRendezVous.edit', [$type->id]) }}"><i
                                                        class="uil uil-pen fs-5"></i></a></td>
                                            {{-- <td>
                                                <form action="{{ route('TypeRendezVous.destroy', [$type->id]) }}"
                                                    method="post">
                                                    @csrf
                                                    @method('DELETE')
                                                    <button class="btn btn-sm btn-danger rounded-pill" type="submit"><i
                                                            class="uil uil-trash fs-5"></i></button>
                                                </form>
                                            </td> --}}
                                        </tr>
                                    @empty
                                        <h3>Tableau Vide</h3>
                                    @endforelse
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
@endsection
