{{-- Shared filter bar. Passing `formAction` plus the *Name props turns it into a real GET form that reloads the listing; without them it renders as the static display-only bar the detail-page tabs still use. --}} @props([ 'formAction' => null, 'hiddenFields' => [], 'dateId' => 'reportDateRange', 'dateName' => null, 'dateValue' => 'Mar 01 – Mar 20, 2026', 'select1Id' => 'reportEvent', 'select1Name' => null, 'select1Label' => 'All Events', 'select1Options' => [ 'all' => 'All', 'nz2026' => 'NZ League 2026', 'icl2026' => 'ICL League 2026' ], 'select1Selected' => 'all', 'select2Id' => 'reportStatus', 'select2Name' => null, 'select2Label' => 'Status', 'select2Options' => [ 'active' => 'Active', 'inactive' => 'Inactive', 'pending' => 'Pending' ], 'select2Selected' => 'active', 'searchId' => 'reportSearch', 'searchName' => null, 'searchValue' => '', 'searchPlaceholder' => 'Search Here...', 'searchFirst' => false ]) @php $isForm = (bool) $formAction; // The custom dropdowns fire a bubbling change event on the hidden native // select, so submitting on change works for both. $autoSubmit = $isForm ? 'this.form.submit()' : null; @endphp
<{{ $isForm ? 'form' : 'div' }} @if($isForm) method="GET" action="{{ $formAction }}" @endif class="filter-grid txn-filter-grid"> @if($isForm) @foreach($hiddenFields as $hiddenName => $hiddenValue) @endforeach @endif @if($searchFirst)
Search
@endif
Date Range
@if($select1Id)
{{ $select1Label }}
@endif @if($select2Id)
{{ $select2Label }}
@endif @if(!$searchFirst)
Search
@endif