@props([ 'variant' => 'on-light', 'mark' => false, 'alt' => null, 'class' => '', ]) @php $settings = $siteSettings ?? null; $uploadedPath = is_object($settings) ? ($settings->logo_path ?? null) : null; $uploadedAlt = is_object($settings) ? ($settings->logo_alt ?? null) : null; $resolvedAlt = $alt ?? (filled($uploadedAlt) ? $uploadedAlt : null) ?? ((is_object($settings) && filled($settings->brand_name ?? null)) ? $settings->brand_name : 'Amare Assessoria'); $variant = $variant === 'on-dark' ? 'on-dark' : 'on-light'; $kind = $mark ? 'mark' : 'lockup'; $staticSrc = asset("brand/{$kind}-{$variant}.webp"); $usesUploadedLogo = filled($uploadedPath); $src = $usesUploadedLogo ? \Illuminate\Support\Facades\Storage::disk('public')->url($uploadedPath) : $staticSrc; // Reserve the box before the image arrives (SPEC §6.4). The intrinsic size // of the shipped assets is known and fixed; an uploaded logo has arbitrary // dimensions, so it gets no attributes rather than wrong ones. The CSS // classes still govern the rendered size in both cases — width/height only // give the browser the aspect ratio to reserve. $intrinsic = $usesUploadedLogo ? [] : ($mark ? ['width' => 512, 'height' => 257] : ['width' => 512, 'height' => 495]); @endphp merge([ 'src' => $src, 'alt' => $resolvedAlt, 'class' => trim('brand-logo '.$class), 'decoding' => 'async', 'loading' => 'eager', ] + $intrinsic) }} />