@extends('admin.layouts.app')

@section('title', __('dashboard.edit_user'))

@section('content')
<x-admin.page-header title="{{ __('dashboard.edit_user') }}" :breadcrumbs="[__('dashboard.users') => route('admin.users.index'), __('dashboard.edit') => '']" />

<div class="row">
    <div class="col-lg-8">
        <div class="card">
            <div class="card-header">
                <h5 class="card-title mb-0">{{ __('dashboard.user_information') }}</h5>
            </div>
            <div class="card-body">
                <form action="{{ route('admin.users.update', $user) }}" method="POST">
                    @csrf
                    @method('PUT')

                    <x-admin.form-input
                        label="{{ __('dashboard.name') }}"
                        name="name"
                        :value="$user->name"
                        placeholder="{{ __('dashboard.enter_user_name') }}"
                        :required="true"
                    />

                    <x-admin.form-input
                        label="{{ __('dashboard.email') }}"
                        name="email"
                        type="email"
                        :value="$user->email"
                        placeholder="{{ __('dashboard.enter_email_address') }}"
                        :required="true"
                    />

                    <x-admin.form-input
                        label="{{ __('dashboard.password') }}"
                        name="password"
                        type="password"
                        placeholder="{{ __('dashboard.leave_blank_to_keep') }}"
                        helper="{{ __('dashboard.leave_blank_to_keep') }}"
                    />

                    <x-admin.form-input
                        label="{{ __('dashboard.password_confirmation') }}"
                        name="password_confirmation"
                        type="password"
                        placeholder="{{ __('dashboard.confirm_password') }}"
                    />

                    <div class="d-flex gap-2">
                        <button type="submit" class="btn btn-primary">
                            <i class="ri-save-line align-middle me-1"></i> {{ __('dashboard.update_user') }}
                        </button>
                        <a href="{{ route('admin.users.index') }}" class="btn btn-light">{{ __('dashboard.cancel') }}</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection
