27 lines
561 B
PHP
27 lines
561 B
PHP
@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" class="w-7 h-7" />
|
|
@endif
|
|
</a>
|
|
</li>
|