@props(['data', 'currentDivision']) @php // 1. Buscamos los datos de la división actual en el JSON // Si no existe o es una división vacía, intentamos caer en 'main' como respaldo $representative = $data[$currentDivision] ?? null; // 2. Validación crítica: Solo mostramos si hay una imagen o un título // Esto evita mostrar divs vacíos si la división tiene puros valores null $hasContent = $representative && (!empty($representative['image']) || !empty(translate_data($representative['title']))); @endphp @if($hasContent)
{{-- Validación de imagen --}} @if(!empty($representative['image'])) Representative @endif
{{-- Título --}} @if($title = translate_data($representative['title']))

{{ $title }}

@endif {{-- Descripción --}} @if($description = translate_data($representative['description']))

{{ $description }}

@endif
@endif