<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
    aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">{{ $title }}</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
                    <svg> ... </svg>
                </button>
            </div>
            <div class="modal-body">
                <div id="error_message"></div>


                <div class="row mb-3">
                    <label for="full_name" class="col-sm-4 col-form-label">Name</label>
                    <div class="col">
                        <input type="text" class="form-control" id="full_name"
                            value="{{ $user ? $user->full_name : '' }}">
                    </div>
                </div>

                <div class="row mb-3">
                    <label for="qty" class="col-sm-4 col-form-label">Email</label>
                    <div class="col">
                        <input type="email" class="form-control" id="email"
                            value="{{ $user ? $user->email : '' }}">
                    </div>
                </div>

                <div class="row mb-3">
                    <label for="service_category_id" class="col-sm-4 col-form-label">Role</label>
                    <div class="col">
                        <select id="role_name" class="form-select">
                            <option selected disabled>Choose...</option>
                                @foreach ($role as $item)
                                    <option value="{{ $item->name }}">{{ $item->name }}</option>
                                @endforeach
                         </select>
                    </div>
                </div>


                <div class="row mb-3">
                    <label for="qty" class="col-sm-4 col-form-label">Password</label>
                    <div class="col">
                        <input type="password" class="form-control" id="password">
                    </div>
                </div>


            </div>

            <div class="modal-footer">
                <button class="btn btn btn-light-dark" data-bs-dismiss="modal"><i class="flaticon-cancel-12"></i>
                    Discard</button>
                @if ($action == 'create')
                    <button type="button" class="btn btn-primary" id="create">Create</button>
                @elseif ($action == 'update')
                    <input type="hidden" id="user_id" value="{{ $user->id }}">
                    <button type="button" class="btn btn-primary" id="update">Update</button>
                @endif
            </div>
        </div>
    </div>
