{{-- Date range filter --}}
<div class="hub-filter">
    <div class="hub-filter__label">
        <i class="ri-calendar-2-line"></i>
        {{ $filterLabel ?? 'Sold between' }}
    </div>
    <form method="GET" action="{{ $formAction }}" id="{{ $formId }}" data-hub-filter-form>
        <div class="row g-3 align-items-end">
            <div class="col-sm-auto">
                <div class="hub-date-range">
                    <input type="date" name="date_from" class="form-control form-control-sm" value="{{ $dateFrom }}" style="min-width: 10.5rem;">
                    <span class="hub-date-range__sep">to</span>
                    <input type="date" name="date_to" class="form-control form-control-sm" value="{{ $dateTo }}" style="min-width: 10.5rem;">
                </div>
            </div>
            @if(!empty($extraFields))
                {{ $extraFields }}
            @endif
        </div>
        <div class="hub-date-presets">
            <button type="button" class="btn btn-outline-secondary btn-sm" data-date-preset="this_month">This month</button>
            <button type="button" class="btn btn-outline-secondary btn-sm" data-date-preset="last_month">Last month</button>
            <button type="button" class="btn btn-outline-secondary btn-sm" data-date-preset="last_30">Last 30 days</button>
            <button type="button" class="btn btn-outline-secondary btn-sm" data-date-preset="this_fy">This FY</button>
        </div>
        <div class="hub-filter__actions">
            <button type="submit" class="btn btn-sm hub-btn-primary">
                <i class="ri-filter-3-line me-1"></i> Apply
            </button>
            @if(!empty($clearUrl))
                <a href="{{ $clearUrl }}" class="btn btn-sm btn-light border hub-btn-outline">Clear</a>
            @endif
            @if(!empty($exportId))
                <a href="#" class="btn btn-sm hub-btn-primary hub-btn-export ms-sm-auto" id="{{ $exportId }}"
                   data-hub-export data-export-icon="ri-file-excel-2-line">
                    <i class="ri-file-excel-2-line"></i> Export Excel
                </a>
            @endif
        </div>
    </form>
</div>
