fix: remove dead search property, simplify empty state message

This commit is contained in:
Ovidiu U
2026-04-07 22:04:15 +01:00
parent a576ef6b4a
commit c4f5fd042b
3 changed files with 2 additions and 4 deletions

View File

@@ -14,13 +14,12 @@ final class StationList extends Component
public bool $hasSearched = false;
public string $search = '';
public int $radius = 5;
#[On('stations-found')]
public function handle(array $results, array $meta, int $radius = 5, ?array $prediction = null): void
{
// $prediction is handled by fuel.recommendation component
$this->results = $results;
$this->meta = $meta;
$this->radius = $radius;

View File

@@ -16,7 +16,7 @@
</div>
@empty
<p class="text-sm text-text-muted">
No stations found within {{ $radius }} {{ str('mile')->plural($radius) }} of "{{ $search }}".
No stations found within {{ $radius }} {{ str('mile')->plural($radius) }}.
</p>
@endforelse
</div>

View File

@@ -40,7 +40,6 @@ it('shows station cards after stations-found event', function () {
it('shows empty state message when stations-found has no results', function () {
Livewire::test(StationList::class)
->set('search', 'ZZ99 9ZZ')
->dispatch('stations-found', results: [], meta: ['count' => 0], prediction: null, radius: 5)
->assertSet('hasSearched', true)
->assertSee('No stations found');