@props([
    'active' => false,
    'label' => null,
    'icon' => null,
])

@php
    $isActive = (bool) $active;

    $classes = $isActive ? 'is-active' : null;

    $iconComponent = null;
    if ($icon) {
        $iconComponent = $isActive
            ? 'icon-solid.'.$icon
            : 'icon-'.$icon;
    }
@endphp

<li class="app-button">
    <a {{ $attributes->merge(['class' => $classes]) }} aria-label="{{ $label }}">
        @if ($iconComponent)
        <x-dynamic-component :component="$iconComponent" />
        @endif
    </a>
</li>
