Files
laraundfelix/resources/views/filament/communication/answers.blade.php
T
2026-11-27 18:03:45 +01:00

28 lines
1.4 KiB
PHP

@php
/** @var \App\Domain\Communication\Inquiry $record */
$record = $getRecord();
$answers = collect($record->answers ?? []);
$steps = $answers->groupBy(fn ($answer) => $answer['step'] ?? '');
@endphp
@if ($answers->isEmpty())
<p class="text-sm text-gray-500">Es wurden keine Antworten gespeichert.</p>
@else
<div style="display: grid; gap: 1.25rem;">
@foreach ($steps as $step => $stepAnswers)
@foreach ($stepAnswers->groupBy(fn ($answer) => $answer['group'] ?? '') as $group => $groupAnswers)
<section aria-label="{{ trim($step.' '.$group) ?: 'Antworten' }}">
@if ($group !== '' || $step !== '')
<h3 style="margin-bottom: .25rem; font-weight: 600;">{{ $step }}@if ($group !== '' && $group !== null) · {{ $group }}@endif</h3>
@endif
<dl style="display: grid; grid-template-columns: minmax(10rem, 18rem) 1fr; gap: .25rem 1rem; margin: 0;">
@foreach ($groupAnswers as $answer)
<dt style="color: #6b7280;">{{ $answer['label'] }}</dt>
<dd style="margin: 0; white-space: pre-line;">{{ $answer['display'] }}</dd>
@endforeach
</dl>
</section>
@endforeach
@endforeach
</div>
@endif