{{-- @intent Bloco `faq`: perguntas frequentes com resposta em AST (ADR-028). @description `
/` nativos: abre e fecha **sem JavaScript** e o leitor de tela anuncia o estado. A pergunta é o rótulo do `` (sem heading extra). --}} @use('Services\RichText\Contracts\RichTextRenderer') @props([ 'props' => [], 'media' => [], 'blockId' => null, ]) @php $renderer = app(RichTextRenderer::class); $title = is_string($props['title'] ?? null) ? $props['title'] : null; $items = []; foreach (is_array($props['items'] ?? null) ? $props['items'] : [] as $item) { if (! is_array($item) || ! is_string($item['question'] ?? null) || ! is_array($item['answer'] ?? null)) { continue; } $items[] = [ 'question' => $item['question'], 'answer' => $renderer->toHtml($item['answer']), ]; } $headingId = is_string($blockId) && $blockId !== '' ? preg_replace('/[^a-z0-9-]/', '', strtolower($blockId)).'-title' : null; @endphp @if ($title !== null && $items !== [])

{{ $title }}

@foreach ($items as $item)
{{ $item['question'] }} @if ($item['answer'] !== '')
{!! $item['answer'] !!}
@endif
@endforeach
@endif