<div class="col card--ui" id="card--dashboard">

        <div class="container">

            @if (session()->has('error'))
                <div class="alert alert-danger" role="alert">
                    {{ session()->get('error') }}
                </div>
            @endif

            <div class="row">
                <div class="col">

                    <form action="">

                        <div class="row mb-3">
                            <div class="col-md-6">
                                <div class="form--item">
                                    <label for="inputName" class="form-label"><b>Nome</b></label>
                                    @if($update)
                                        <input class="form-control  @error('name') is-invalid @enderror" type="text" id="name" placeholder="Nome" wire:model="name">
                                        @error('name')
                                            <div class="invalid-feedback">{{ $message }}</div>
                                        @enderror
                                    @else
                                        <br>{{$name}}
                                    @endif
                                </div>
                            </div>

                            <div class="col-md-6">
                                <div class="form--item">
                                    <label for="email" class="form-label"><b>Email</b></label>
                                    @if($update)
                                        <input class="form-control  @error('email') is-invalid @enderror" type="text" id="email" placeholder="Email" wire:model="email">
                                        @error('email')
                                            <div class="invalid-feedback">{{ $message }}</div>
                                        @enderror
                                    @else
                                        <br>{{$email}}
                                    @endif
                                </div>
                            </div>
                        </div>

                        <!-- // inline input field -->

                        <div class="form--item">
                            <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
                            @if($update)
                                <button type="submit" class="btn--ui" wire:click.prevent="save()">Salva</button>
                            @else
                                <button type="submit" class="btn--ui" wire:click.prevent="edit()">Modifica</button>
                            @endif
                        </div>

                        <br><br>

                        @if($editPassword)

                            <div class="row mb-3">
                                <div class="col-md-6">
                                    <div class="form--item">
                                        <label for="password" class="form-label">Password</label>
                                        <input class="form-control js-keyupTitle @error('password') is-invalid @enderror" type="password" id="password" wire:model="password">
                                        @error('password')
                                            <div class="invalid-feedback">{{ $message }}</div>
                                        @enderror
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form--item">
                                        <label for="passwordConfirm" class="form-label">Conferma password</label>
                                        <input class="form-control js-keyupTitle @error('passwordConfirm') is-invalid @enderror" type="password" id="passwordConfirm" wire:model="passwordConfirm">
                                        @error('passwordConfirm')
                                            <div class="invalid-feedback">{{ $message }}</div>
                                        @enderror
                                    </div>
                                </div>
                            </div>
                            <span style="color:red">{{$errorConfirm}}</span>

                        @endif

                        <div class="form--item" style="margin-top: 10px">
                            @if($editPassword)
                                <button type="submit" class="btn--ui" wire:click.prevent="updatePwd()">Salva</button>
                            @else
                                <button type="submit" class="btn--ui" wire:click.prevent="editPwd()">Modifica password</button>
                            @endif
                            <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
                        </div>

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