fix: remove dead search property, simplify empty state message
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user