@php $title = $data['title'] ?? ''; $subtitle = $data['subtitle'] ?? ''; $text = $data['text'] ?? ''; $buttonText = $data['button_text'] ?? ''; $buttonLink = $data['button_link'] ?? '#'; $imageUrl = $data['image_url'] ?? null; $imageAlt = $data['image_alt'] ?? 'Imagem da seção'; $backgroundColor = $data['background_color'] ?? '#ffffff'; $textColor = $data['text_color'] ?? '#333333'; $renderText = function($text) { if (is_string($text) && (strpos($text, '{"type"') === 0 || strpos($text, '{"content"') === 0)) { return app(\V2\Services\ContentRichEditor\Services\ContentRichEditorRendererService::class)->toHtml($text); } return $text; }; // Configurações de Posicionamento e Tamanho $imagePosition = $data['image_position'] ?? 'left'; $sizeType = $data['image_size_type'] ?? '50'; $customSize = $data['image_size_custom'] ?? ''; $imageWidth = ($sizeType === 'custom' && $customSize) ? $customSize : $sizeType; $textWidth = 100 - (int)$imageWidth; // Se for 100%, força top/bottom ou ocupa tudo if ((int)$imageWidth >= 100) { $imageWidth = 100; $textWidth = 100; if ($imagePosition === 'left') $imagePosition = 'top'; if ($imagePosition === 'right') $imagePosition = 'bottom'; } $isVertical = in_array($imagePosition, ['top', 'bottom']); @endphp
{{-- Container da Imagem --}}
@if($imageUrl) {{ $imageAlt }} @else
@endif
{{-- Container do Texto --}}
@if($subtitle) {{ $subtitle }} @endif @if($title)

{{ $title }}

@endif
{!! $renderText($text) !!}
@if($buttonText) {{ $buttonText }} @endif