@php
    $options = [
        'name_asc' => __('Catalog::theme.sidebar.sort.options.name_asc'),
        'name_desc' => __('Catalog::theme.sidebar.sort.options.name_desc'),
        //'points_desc' => __('Catalog::theme.sidebar.sort.options.points_asc'),
        //'points_asc' => __('Catalog::theme.sidebar.sort.options.points_desc'),
    ];
    $keyword = trim((string) request()->get('keyword', ''));
    $selected = request()->get('sort', 'name_asc');
    if ($keyword) {
        $options = ['' => 'Relevance'];
        $selected = '';
    }
@endphp
<div class="panel panel-default panel-squared">
    <div class="panel-heading">
        <label for="sort" class="m-0 catalog-filter-heading">{{ __('Catalog::theme.sidebar.sort.heading') }}</label>
    </div>
    <div class="panel-body">
        <select class="form-control" id="sort" name="sort">
            @foreach($options as $value => $text)
                <option value="{{ $value }}" @if ($value == $selected)selected="selected" @endif>{{ $text }}</option>
            @endforeach
        </select>
    </div>
</div>
