@include('layouts.header')
<main>
<div class="mb-4 pb-4"></div>
<section class="login-register container mb-5">
<h2 class="d-none">User Profile</h2>
<ul class="nav nav-tabs mb-5" id="login_register" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link nav-link_underscore" id="register-tab" data-bs-toggle="tab" href="#tab-item-register" role="tab" aria-controls="tab-item-register" aria-selected="false">User Profile</a>
</li>
</ul>
<div class="tab-content pt-2" id="login_register_tab_content">
<!--<div class="tab-pane fade" id="tab-item-register" role="tabpanel" aria-labelledby="register-tab">-->
    <div class="register-form">

        @if(session('success'))
        <div class="alert alert-success" style="padding-top: 10px; padding-bottom: 10px;">
            {{ session('success') }}
        </div> 
         @elseif(session('error'))
        <div class="alert alert-danger" style="padding-top: 10px; padding-bottom: 10px;">
            {{ session('error') }}
        </div>
        @endif

    <form action="{{ route('update.account', $user->id) }}" method="POST" class="needs-validation" novalidate>
     @csrf   
    <div class="form-floating mb-3">
    <input name="name" type="text" class="form-control form-control_gray" id="customerNameRegisterInput" placeholder="Username" value="{{ $user->name }}" >
    <label for="customerNameRegisterInput">Username</label>
    @if($errors->has('name'))
        <p class="text-danger">{{ $errors->first('name') }}</p>
    @endif
    </div>
    <div class="pb-3"></div>
    
    <div class="form-floating mb-3">
    <input name="email" type="email" class="form-control form-control_gray" id="customerEmailRegisterInput" value="{{ $user->email }}" placeholder="Email address *">
    <label for="customerEmailRegisterInput">Email address *</label>
    @if($errors->has('email'))
        <p class="text-danger">{{ $errors->first('email') }}</p>
    @endif
    </div>

    <div class="pb-3"></div>
    <div class="form-floating mb-3">
    <input name="mobile" type="tel" class="form-control form-control_gray" id="customerPasswodRegisterInput" placeholder="Mobile *" value="{{ $user->mobile }}" pattern="[0-9]{10}" maxlength="10">
    <label for="customerPasswodRegisterInput">Mobile *</label>
    @if($errors->has('mobile'))
        <p class="text-danger">{{ $errors->first('mobile') }}</p>
    @endif
    </div>

    <button class="btn btn-primary w-100 text-uppercase" type="submit">Update</button>
    </form>
    </div>
<!--</div>-->
</div>
</section>
</main>
 
@include('layouts.footer')