<div class="table-responsive">
    <table class="table table-sm table-hover table-striped table-bordered mb-0">
        <thead class="fw-bold text-secondary bg-light">
            <tr>
                <th>Created At</th>
                <th>Entity Type</th>
                <th>Entity Uid</th>
                <th>Event</th>
                <th>Details</th>
                <th>Performer User</th>
                <th>Created By</th>
            </tr>
        </thead>
        <tbody>
            @foreach ($userEvents as $userEvent)
                <tr>
                    <td>{{ friendly_date($userEvent->created_at) }}</td>
                    <td>{{ $userEvent->entity_type }}</td>
                    <td>{{ $userEvent->entity_uid }}</td>
                    <td>{{ $userEvent->event }}</td>
                    <td>
                        <?php parseRender(json_decode($userEvent->detail_json)); ?>
                    </td>
                    <td>
                        @if ($userEvent->user)
                            <a
                                href="{{ route('admin.users.view.dashboard', $userEvent->user) }}">{{ $userEvent->user->displayName() }}</a>
                        @else
                            --
                        @endif
                    </td>
                    <td>
                        @if ($userEvent->createdByUser)
                            <a
                                href="{{ route('admin.users.view.dashboard', $userEvent->createdByUser) }}">{{ $userEvent->createdByUser->displayName() }}</a>
                        @else
                            --
                        @endif
                    </td>
                </tr>
            @endforeach
        </tbody>
    </table>
</div>
