@php
$headerContent = $headerContent ?? [];
$configuredLinks = collect($headerContent['links'] ?? []);
$navigationLinks = $configuredLinks->isNotEmpty()
? $configuredLinks
: collect($primaryNavigation ?? [])->map(fn (array $item): array => [
'enabled' => true,
'label' => $item['label'] ?? 'Link',
'url' => $item['url'] ?? '#',
]);
$navigationLinks = $navigationLinks->filter(
fn (array $link): bool => filter_var($link['enabled'] ?? true, FILTER_VALIDATE_BOOL)
);
@endphp
@else
{{ $headerContent['brand_text'] ?? $siteTitle }}
@endif
@if (filter_var($headerContent['show_navigation'] ?? true, FILTER_VALIDATE_BOOL) && $navigationLinks->isNotEmpty())
@endif