<div class="modal-header">
    <h1 class="modal-title fs-6" id="exampleModalLabel"> <i class="fal fa-user me-1"></i> {{$head ?? ''}} </h1>
    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
    <div class="modal-form">
        <div class="row">
            <div class="col-lg-12">
                <div class="form-group mb-3">
                    <div class="avatar-upload">
                        <div class="avatar-preview">
                            <div id="imagePreview" style="background-image: url({{asset($user->photo ?? 'assets/admin/images/avatar.png')}});">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-6">
                <div class="form-group mb-3">
                    <label for="" class="d-block mb-2"> {{ __('users.name') }} </label>
                    <p class="form-control" >{{$user->name ?? ''}}</p>
                </div>
            </div>
            <div class="col-lg-6">
                <div class="form-group mb-3">
                    <label for="" class="d-block mb-2"> {{ __('users.email') }} </label>
                    <p class="form-control" >{{$user->email ?? ''}}</p>
                </div>
            </div>
            <div class="col-lg-6">
                <div class="form-group mb-3">
                    <label for="" class="d-block mb-2"> {{ __('users.phone') }} </label>
                    <p class="form-control" >{{$user->phoneCountry->country_key . $user->phone ?? ''}}</p>
                </div>
            </div>
            <div class="col-lg-6">
                <div class="form-group mb-3">
                    <label for="" class="d-block mb-2"> {{ __('users.role') }} </label>
                    <p class="form-control" >{{__('users.roles.'.$user->role)}}</p>
                </div>
            </div>

            <div class="col-lg-12">
                <label for="" class="d-block mb-2"> {{ __('users.Modules') }} </label>
                <div class="clearfix"></div>
                <div class="row">
                    @foreach($modules as $key=> $group_modules)
                        <div class="col-lg-12">
                            <hr>
                            <h5 for="" class="d-block mb-2"> {{ __($key.'.head') }} </h5>
                        </div>
                        @foreach($group_modules as $row)
                            <div class="col-sm-4">
                                <div class="custom-control custom-checkbox">
                                    <input type="checkbox" {{ in_array($row['id'], $user_modules) ? 'checked' : '' }} value="{{ $row->id }}" class="custom-control-input" disabled id="module_{{ $row->id }}" name="modules[]">
                                    <label class="custom-control-label" for="module_{{ $row->id }}"> {{ $row['description'] }} </label>
                                </div>
                            </div>
                        @endforeach
                    @endforeach
                </div>
            </div>

        </div>
    </div>
</div>
