@php $record = $getRecord(); $changes = is_array($record->properties) ? $record->properties : []; @endphp
merge($getExtraAttributes())->class(['ml-11']) }}> @switch($record->type) {{-- Note & Comment --}} @case('note') @case('comment')
{{-- Subject --}} @if ($record->subject)
@lang('chatter::views/filament/infolists/components/messages/content-text-entry.subject')
{!! $record->subject !!}
@endif {{-- Body --}} @if ($record->body)
{!! $record->body !!}
@endif {{-- Attachments --}} @if ($record->attachments->isNotEmpty())
@foreach($record->attachments as $attachment) @php $fileExtension = strtolower(pathinfo($attachment->original_file_name, PATHINFO_EXTENSION)); $isImage = in_array($fileExtension, ['jpg', 'jpeg', 'png', 'gif', 'svg', 'webp', 'bmp']); $isPreviewable = $isImage || in_array($fileExtension, ['pdf']); $icon = match($fileExtension) { 'pdf' => 'heroicon-o-document-text', 'sql' => 'heroicon-o-database', 'csv', 'xlsx', 'xls' => 'heroicon-o-table-cells', 'md', 'txt' => 'heroicon-o-document', 'zip', 'rar', '7z' => 'heroicon-o-archive-box', 'doc', 'docx' => 'heroicon-o-document-text', 'mp4', 'avi', 'mov' => 'heroicon-o-film', 'mp3', 'wav', 'ogg' => 'heroicon-o-musical-note', default => 'heroicon-o-document', }; @endphp
{{-- File Preview / Icon --}}
@if ($isImage) {{ $attachment->original_file_name }} @else @endif
{{-- File Details --}}

{{ $attachment->original_file_name }}

{{ strtoupper($fileExtension) }}

@if($isPreviewable) @endif
@endforeach
@endif
@break {{-- Notification --}} @case('notification') @if ($record->body)
{!! $record->body !!}
@endif {{-- Show changes if applicable --}} @if ( ! empty($changes) && $record->event !== 'created' )
@foreach($changes as $field => $change) @if(is_array($change)) @php $icon = match($change['type']) { 'modified' => '', 'added' => '', default => '', }; @endphp
{!! $icon !!}
{{ ucwords(str_replace('_', ' ', $field)) }} :: @isset($change['old_value']) @if($field === 'due_date') {{ \Carbon\Carbon::parse($change['old_value'])->format('F j, Y') }} @else {!! is_array($change['old_value']) ? implode(', ', $change['old_value']) : $change['old_value'] !!} @endif @endisset @if(isset($change['old_value']) && isset($change['new_value'])) @endif @isset($change['new_value']) @if($field === 'due_date') {{ \Carbon\Carbon::parse($change['new_value'])->format('F j, Y') }} @else {!! is_array($change['new_value']) ? implode(', ', $change['new_value']) : $change['new_value'] !!} @endif @endisset
@endif @endforeach
@endif @break @endswitch