{{-- Activity Item - Minimal One-Line Design --}} @php $eventColor = match($activity->event) { 'created' => 'success', 'updated', 'updated_status', 'updated_active' => 'info', 'deleted' => 'danger', 'login' => 'warning', 'email_sent' => 'primary', 'sms_sent' => 'success', default => 'secondary' }; $eventIcon = match($activity->event) { 'created' => 'plus-circle', 'updated', 'updated_status', 'updated_active' => 'edit', 'deleted' => 'trash', 'login' => 'signin', 'email_sent' => 'mail', 'sms_sent' => 'chat', default => 'activity' }; @endphp
user()->is_admin_manager) x-on:click="Livewire.emit('showModal', 'modals.activity.edit-activity-modal', {{ $activity->id }})" @endif > {{-- Icon --}}
{{-- Main Content --}}
{{-- Type Badge --}} {{ $activity->subject_type_name }} {{-- Description --}} @if($activity->shouldLogDescription) @switch($activity->event) @case('login') {{ __('Login from IP') }}: {{ data_get($activity->properties, 'ip', '-') }} @break @case('updated_status') {{ __('Status changed to') }} {{ $activity->description }} @break @case('updated_active') @case('created_proposal') @case('updated_proposal_status') @case('associated_user_created') @case('project_created') {{ $activity->description }} @break @case('email_sent') {{ __('Email sent') }} @break @case('sms_sent') {{ __('SMS sent') }} @break @default {{ $activity->description }} @endswitch @elseif($activity->subject) {{ $activity->subject?->activity_name }} @endif {{-- Causer --}} @if($activity->causer) @if(auth()->user()->can('users.view') && auth()->user()->can('partners.view')) {{ Str::limit($activity->causer?->activity_name, 20) }} @else {{ Str::limit($activity->causer?->activity_name, 20) }} @endif @endif
{{-- Actions (on hover) --}}
@if($activity->event === 'email_sent' && ($sentEmailId = data_get($activity->properties, 'sentemail_id'))) @endif @if($activity->event === 'sms_sent' && ($sentNotificationId = data_get($activity->properties, 'sent_notification_id'))) @endif
{{-- Timestamp --}}
@if(auth()->user()->is_admin_manager && data_get($activity, 'properties.ip')) {{ $activity->properties['ip'] }} @endif {{ $activity->created_at->format('d/m/y') }} {{ $activity->created_at->format('H:i') }}