@props([
    'filters' => [],
    'clearUrl' => null,
])

@if(count($filters))
    <div {{ $attributes->class(['mf-filter-chips']) }} data-ui="applied-filter-chips">
        <span class="mf-filter-chips-label">Filters</span>
        @foreach($filters as $filter)
            <span class="mf-filter-chip">
                <span>{{ $filter['label'] }}: <strong>{{ $filter['value'] }}</strong></span>
                @if(!empty($filter['removeUrl']))
                    <a href="{{ $filter['removeUrl'] }}" aria-label="Clear {{ $filter['label'] }} filter">×</a>
                @endif
            </span>
        @endforeach
        @if($clearUrl)
            <a class="mf-clear-filters" href="{{ $clearUrl }}">Clear all</a>
        @endif
    </div>
@endif
