@extends('layouts.app')
@section('page_title', __('app.users'))
@section('content')
<div class="top-card p-3"><div class="d-flex justify-content-between mb-3"><h5 class="fw-bold">{{ __('app.users') }}</h5><a class="btn btn-success" href="{{ route('users.create') }}"><i class="fa-solid fa-plus"></i> {{ __('app.add_user') }}</a></div><div class="table-responsive"><table class="table align-middle"><thead><tr><th>{{ __('app.name') }}</th><th>{{ __('app.email') }}</th><th>{{ __('app.role') }}</th><th>{{ __('app.status') }}</th><th>{{ __('app.action') }}</th></tr></thead><tbody>@foreach($users as $user)<tr><td>{{ $user->name }}</td><td>{{ $user->email }}</td><td>{{ $user->roleRecord?->name ?? $user->role }}</td><td><span class="badge {{ $user->is_active?'bg-success':'bg-danger' }}">{{ $user->is_active?__('app.active'):__('app.inactive') }}</span></td><td><a class="btn btn-sm btn-light" href="{{ route('users.edit',$user) }}"><i class="fa-solid fa-pen"></i></a></td></tr>@endforeach</tbody></table></div>{{ $users->links() }}</div>
@endsection
