{{-- Shared CRM communication-log panel. Expects $interactions in scope and the LogsInteractions trait on the host component. Channels are always the CRM list (Interaction::CRM_TYPES), whatever the host passes. --}} @php $interactionTypes = \App\Models\Interaction::CRM_TYPES; $interactionContacts = $showInteractions ? $this->interactionContacts() : collect(); $needsNextAction = $showInteractions && $this->interactionNeedsNextAction(); @endphp {{ __('Communication Log') }} @if ($subjectLabel) : {{ $subjectLabel }} @endif {{-- Add form --}} @if ($canManage)
@if ($needsNextAction)
@endif
{{ __('Log interaction') }}
@endif {{-- Timeline --}}
@forelse ($interactions as $interaction)
{{ \Illuminate\Support\Str::of($interaction->type)->substr(0, 2)->upper() }}
{{ __($interactionTypes[$interaction->type] ?? ucfirst($interaction->type)) }} @if ($interaction->direction) ยท {{ __(\App\Models\Interaction::DIRECTIONS[$interaction->direction] ?? $interaction->direction) }} @endif {{ $interaction->occurred_at?->diffForHumans() }}

{{ $interaction->body }}

@if ($interaction->outcome)

{{ __('Outcome') }}: {{ $interaction->outcome }}

@endif

{{ $interaction->user?->name ?? __('System') }} @if ($interaction->contact) {{ __('with :name', ['name' => $interaction->contact->name]) }} @endif

@empty

{{ __('No interactions logged yet.') }}

@endforelse
{{ __('Close') }}