<x-app-layout>
<div class="col-12 mt-2">
    <div class="card">
        <div class="card-body">
            <x-form method="POST" action="{{ route('users.update',['user'=>$admin->id] ) }}" enctype="multipart/form-data">
             @method('PUT')
             @csrf
                <div class="card">
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="card">
                                    <div class="card-body">
                                        <h5 class="dividing">{{ __('General Info') }}</h5>
                                        <div class="row mt-3">
                                            <x-form.input name="name" value="{{ $admin->name }}" classGroup="col-md-6 required" />
                                            <x-form.input name="email" value="{{ $admin->email }}" classGroup="col-md-6 required" />
                                        </div>
                                        <x-form.entity name="office_id" label="Office" :items="App\Models\Office::all()" value="{{ $admin->office_id }}"  choiceLabel="name" classGroup="required" />
                                    </div>
                                </div>
                                <div class="card">
                                    <div class="card-body">
                                            <x-form.input name="password" type="password"  />
                                            <x-form.switch name="status" value="{{ $admin->status }}"  />
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="card">
                                    <div class="card-body">
                                        <h5 class="dividing">{{ __('Additional information') }}</h5>
                                        <div class="mt-3">
                                            <x-form.input name="phone" value="{{ $admin->phone }}" classGroup="required"  />
                                            <x-form.select name="locale" value="{{ $admin->locale }}" :items="[['value'=>'ar','label'=>'العربية'],['value'=>'en','label'=>'English']]"  />
                                            <x-form.upload name="image" value="{{ $admin->image }}" label="Avatar" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="card-footer">
                        <x-button class="btn btn-primary" > {{ __('Save') }}  </x-button>
                    </div>
                </div>
            </x-form>
        </div>
    </div>
</div>


</x-app-layout>

