{{-- The conversation about one difference, as a conversation. It reads as a chat because that is what it is: she says what she thinks happened, a director asks something back, she answers, somebody rules on it. Written out as "You said / They asked" it stopped being clear whose words were whose the moment a third person opened the page — a director reading "you said" was reading the cashier's words in the second person. Faces and names carry that without a single label. Everyone has a picture: the fallback is initials drawn locally as a data URI, so nothing here depends on an upload or an outside service. Expects: $line (with reconciliation.performer, querier, reviewer). Optional: $compact, for tight spaces like a table cell. --}} @php $me = auth()->id(); $tz = config('app.display_timezone'); $performer = $line->reconciliation?->performer; $decided = in_array($line->reason_status, ['approved', 'rejected'], true); // Oldest first, the way a thread reads. The explanation is the opening // message even after a correction rewrote it: it is still her account of // the day, and the reply below it is what she said when she changed it. $messages = []; if (filled($line->reason)) { $messages[] = [ 'user' => $performer, 'at' => $line->reconciliation?->submitted_at, 'text' => $line->reason, 'label' => null, 'tone' => 'plain', ]; } if (filled($line->query_note)) { $messages[] = [ 'user' => $line->querier, 'at' => $line->queried_at, 'text' => $line->query_note, 'label' => __('Sent it back'), 'tone' => 'query', ]; } if (filled($line->reply_note)) { $messages[] = [ 'user' => $performer, 'at' => $line->replied_at, 'text' => $line->reply_note, 'label' => null, 'tone' => 'plain', ]; } if ($decided) { $messages[] = [ 'user' => $line->reviewer, 'at' => $line->reviewed_at, 'text' => $line->review_note, 'label' => $line->reason_status === 'approved' ? __('Approved') : __('Rejected'), 'tone' => $line->reason_status === 'approved' ? 'approved' : 'rejected', ]; } @endphp @if ($messages !== [])
{{ $user?->name ?? __('Someone') }} @if ($m['label']) $m['tone'] === 'query', 'bg-emerald-100 text-emerald-700' => $m['tone'] === 'approved', 'bg-rose-100 text-rose-700' => $m['tone'] === 'rejected', ])>{{ $m['label'] }} @endif @if ($m['at']) {{ $m['at']->timezone($tz)->format('d M H:i') }} @endif
@if (filled($m['text']))