@props(['sections' => []])
@foreach ($sections as $section)
@php
$type = is_array($section) ? ($section['type'] ?? null) : null;
@endphp
@if ($type === 'heading')
{{ $section['content'] ?? '' }}
@elseif ($type === 'rich_text')
{!! $section['content'] ?? '' !!}
@elseif ($type === 'process_steps')
@foreach ($section['items'] ?? [] as $index => $step)
-
Paso {{ $index + 1 }}
{{ $step['title'] ?? '' }}
{{ $step['description'] ?? '' }}
@endforeach
@elseif ($type === 'differentiators')
@foreach ($section['items'] ?? [] as $item)
@php
$title = is_array($item) ? ($item['title'] ?? '') : $item;
$description = is_array($item) ? ($item['description'] ?? null) : null;
@endphp
-
{{ $title }}
@if (filled($description))
{{ $description }}
@endif
@endforeach
@elseif ($type === 'image')
@php
$src = \App\Support\MediaPath::extract($section['image'] ?? null);
if (filled($src) && ! str_starts_with($src, 'http') && ! str_starts_with($src, '/')) {
$src = is_file(public_path($src)) ? asset($src) : asset('storage/'.$src);
}
@endphp
@if (filled($src))
@if (filled($section['caption'] ?? null))
{{ $section['caption'] }}
@endif
@endif
@elseif ($type === 'faq')
@foreach ($section['items'] ?? [] as $item)
- {{ $item['question'] ?? '' }}
- {{ $item['answer'] ?? '' }}
@endforeach
@endif
@endforeach