@extends('layouts.admin')

@section('content')
    <div class="card shadow mb-4">
        <div class="card-header py-3 d-flex">
            @include("backend.users.blocs.dt-image",['row' => $user])


           <span style="margin-left: 5px;"> {{ $user->full_name }}</span>
{{--            <div class="ml-auto">--}}
{{--                <a href="{{ route('admin.users.index') }}" class="btn btn-primary">--}}
{{--                    <span class="text">Back to users</span>--}}
{{--                </a>--}}
{{--            </div>--}}
        </div>
        <div class="table-responsive">
            <table class="table table-hover">
                <tbody>
                <tr>
                    <th>ID</th>
                    <td>{{ $user->id }}</td>
                    <th>First Name</th>
                    <td>{{ $user->first_name }}</td>
                    <th>Last Name</th>
                    <td>{{ $user->last_name }}</td>
                </tr>
                <tr>
                    <th>Email</th>
                    <td>{{ $user->email }}</td>
                    <th>Username</th>
                    <td>{{ $user->username }}</td>
                    <td>Phone</td>
                    <td>{{ $user->phone }}</td>
                </tr>
                <tr>
                    <th>Status</th>
                    <td>{{ $user->active }}</td>
                    <td>Email Verified At</td>
                    <td>{{ $user->email_verified_at ? $user->email_verified_at->format('Y-m-d') : "Undefined" }}</td>
                    <td>Created At</td>
                    <td>{{ $user->created_at ? $user->created_at->format('Y-m-d') : "Undefined" }}</td>
                </tr>

                @if($user->roles)
                    <tr>
                        <th>{{__('Rôles')}}</th>
                        <td>{{ implode(",",$user->roles->pluck('name')->toArray()) }}</td>

                    </tr>
                @endif

                </tbody>
            </table>
        </div>
    </div>
@endsection
