<x-layouts.app :title="__('profile.title')"><x-customer-shell><header class="tp-page-header"><div><p>{{__('customer.my_account')}}</p><h1>{{__('profile.title')}}</h1><span>{{__('profile.description')}}</span></div></header><div class="tp-profile-grid">
<section class="tp-panel"><h2 class="h5">{{__('profile.information')}}</h2><form method="post" action="{{route('profile.update')}}">@csrf @method('PUT')<label class="form-label">{{__('profile.full_name')}}<input class="form-control" name="name" required maxlength="150" value="{{old('name',$u->name)}}"></label>@error('name')<p class="text-danger">{{$message}}</p>@enderror<button class="btn btn-primary">{{__('profile.save')}}</button></form></section>
<section class="tp-panel"><h2 class="h5">{{__('profile.email_section')}}</h2><span class="badge {{$u->hasVerifiedEmail()?'text-bg-success':'text-bg-warning'}}">{{$u->hasVerifiedEmail()?__('profile.verified'):__('profile.not_verified')}}</span><form method="post" action="{{route('profile.email')}}" class="mt-3">@csrf @method('PUT')<label class="form-label">{{__('profile.email')}}<input class="form-control" type="email" name="email" required value="{{old('email',$u->email)}}"></label><label class="form-label">{{__('profile.current_password')}}<input class="form-control" type="password" name="current_password" required autocomplete="current-password"></label>@error('email')<p class="text-danger">{{$message}}</p>@enderror @error('current_password')<p class="text-danger">{{$message}}</p>@enderror<button class="btn btn-primary">{{__('profile.save')}}</button></form>@unless($u->hasVerifiedEmail())<form method="post" action="{{route('profile.verification.send')}}" class="mt-2">@csrf<button class="btn btn-outline-secondary">{{__('profile.resend')}}</button></form>@endunless</section>
<section class="tp-panel"><h2 class="h5">{{__('profile.password_section')}}</h2><form method="post" action="{{route('profile.password')}}">@csrf @method('PUT')<label class="form-label">{{__('profile.current_password')}}<input class="form-control" type="password" name="current_password" required></label><label class="form-label">{{__('profile.new_password')}}<input class="form-control" type="password" name="password" required></label><label class="form-label">{{__('profile.confirm_password')}}<input class="form-control" type="password" name="password_confirmation" required></label>@error('password')<p class="text-danger">{{$message}}</p>@enderror<button class="btn btn-primary">{{__('profile.password_section')}}</button></form></section>
<section class="tp-panel"><h2 class="h5">{{__('profile.roles_status')}}</h2><p>{{__('profile.roles')}}</p><div class="d-flex flex-wrap gap-2">@foreach($u->roles as $role)<span class="badge text-bg-secondary">{{__('roles.'.$role->name)}}</span>@endforeach</div><p class="mt-3">{{__('profile.status')}}: <strong>{{__('profile.'.($u->isActive()?'active':'inactive'))}}</strong></p>@if($u->canAccessPanel(filament()->getPanel('admin')))<a class="btn btn-outline-primary" href="/admin">{{__('profile.admin')}}</a>@endif</section>
<section class="tp-panel tp-profile-sessions"><h2 class="h5">{{__('profile.sessions')}}</h2>@foreach($sessions as $session)<div class="tp-session-row"><span>{{$session['agent']?:'—'}}</span><small>{{$session['last_activity']}} @if($session['current'])· {{__('profile.current_device')}}@endif</small></div>@endforeach<form method="post" action="{{route('profile.sessions.logout-others')}}" class="mt-3">@csrf<label class="form-label">{{__('profile.current_password')}}<input class="form-control" type="password" name="current_password" required></label><button class="btn btn-outline-danger">{{__('profile.logout_others')}}</button></form></section>
</div></x-customer-shell></x-layouts.app>
