@props(['blocks']) @if ($blocks) @if (is_array($blocks)) @foreach ($blocks as $block)
@switch($block['type']) @case('rich_text') @case('html')
{!! $block['data']['content'] !!}
@break @case('markdown')
{!! \Illuminate\Support\Str::markdown($block['data']['content']) !!}
@break @case('image')
{{ $block['data']['alt'] ?? '' }}
@break @case('pdf_embed')
@break @case('youtube_video')
@php preg_match( '/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/', $block['data']['url'], $matches, ); $blockVideoId = $matches[1] ?? null; @endphp @if ($blockVideoId)
@endif
@break @case('hero')
{{ $block['data']['title'] ?? '' }}
@if (!empty($block['data']['title']))

{{ $block['data']['title'] }}

@endif @if (!empty($block['data']['subtitle']))

{{ $block['data']['subtitle'] }}

@endif
@break @case('alert')
{!! $block['data']['content'] !!}
@break @case('button_snippet')
{{ $block['data']['label'] }}
@break @case('card_snippet')
@if (!empty($block['data']['image'])) {{ $block['data']['title'] ?? '' }} @endif
@if (!empty($block['data']['title']))

{{ $block['data']['title'] }}

@endif
{!! $block['data']['content'] !!}
@if (!empty($block['data']['button_label']) && !empty($block['data']['button_url'])) {{ $block['data']['button_label'] }} @endif
@break @default

Unknown block type: {{ $block['type'] }}

@endswitch
@endforeach @elseif(is_string($blocks))
{!! $blocks !!}
@endif @endif