@props([ 'active' => false, // label text (string) 'label' => null, // icon name only 'icon' => null, ]) @php $isActive = (bool) $active; $classes = trim(collect([ 'pagelink', $isActive ? 'is-active' : null, ])->filter()->implode(' ')); $iconComponent = null; if ($icon) { $iconComponent = $isActive ? 'icon-solid.'.$icon : 'icon-'.$icon; } @endphp merge(['class' => $classes]) }}> @if ($iconComponent) @endif @if (!is_null($label)) {{ $label }} @else {{ $slot }} @endif