@php
use App\Services\OrderNoteService;
if (! empty($order)) {
$noteLines = OrderNoteService::displayLinesForOrder($order);
} else {
$noteLines = OrderNoteService::parseAll($noteText ?? '');
}
@endphp
@if(count($noteLines))
@foreach($noteLines as $parsed)
@php
$color = $parsed['color'] ?? OrderNoteService::authorColor($parsed['author'] ?? 'Admin');
$icon = $parsed['icon'] ?? 'fa-thumbtack';
$itemClass = 'order-note-item d-flex align-items-start gap-2';
if (($parsed['type'] ?? '') === 'approved') {
$itemClass .= ' order-note-item--approved';
}
@endphp
{{ $parsed['text'] }}@if(!empty($parsed['meta'])) — {{ $parsed['display_meta'] ?? $parsed['meta'] }}@endif
@endforeach
@elseif(!empty($boxId))
@endif