@php /** @var \Illuminate\Support\Collection $templates */ $catColors = [ 'travel' => 'bg-wa-bubble text-wa-deep', 'healthcare' => 'bg-[#DFF1ED] text-wa-deep', 'education' => 'bg-[#F4E9C9] text-[#7B5A14]', 'ecommerce' => 'bg-accent-coral/15 text-[#A1431F]', 'festival' => 'bg-[#EFE5F5] text-[#5B3D8A]', 'finance' => 'bg-[#13478A]/10 text-[#13478A]', 'utility' => 'bg-paper-50 text-ink-700', ]; $statusDot = [ 'approved' => 'bg-wa-green', 'public' => 'bg-wa-green', 'pending' => 'bg-accent-amber', 'rejected' => 'bg-accent-coral', ]; @endphp @forelse ($templates as $t) @php $cls = $catColors[$t->category] ?? 'bg-paper-50 text-ink-700'; $dot = $statusDot[$t->status] ?? 'bg-paper-300'; // First 5 paragraphs of the body. Body is encrypted text; // we just split on \n\n so the card preview matches what // the operator typed. $bodyHtml = collect(explode("\n\n", (string) $t->template_body)) ->take(5) ->map(fn($p) => '
' . nl2br(e($p)) . '
') ->implode(''); @endphp