fix: use IconEntry for boolean fields in StationResource infolist
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Filament\Resources\StationResource\Pages\ListStations;
|
||||
use App\Filament\Resources\StationResource\Pages\ViewStation;
|
||||
use App\Models\Station;
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Infolists\Components\IconEntry;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Components\Section;
|
||||
@@ -71,26 +72,10 @@ class StationResource extends Resource
|
||||
TextEntry::make('country'),
|
||||
])->columns(3),
|
||||
Section::make('Status')->schema([
|
||||
TextEntry::make('is_supermarket')
|
||||
->label('Supermarket')
|
||||
->badge()
|
||||
->formatStateUsing(fn (bool $state) => $state ? 'Yes' : 'No')
|
||||
->color(fn (bool $state) => $state ? 'success' : 'gray'),
|
||||
TextEntry::make('is_motorway_service_station')
|
||||
->label('Motorway')
|
||||
->badge()
|
||||
->formatStateUsing(fn (bool $state) => $state ? 'Yes' : 'No')
|
||||
->color(fn (bool $state) => $state ? 'success' : 'gray'),
|
||||
TextEntry::make('temporary_closure')
|
||||
->label('Temp Closed')
|
||||
->badge()
|
||||
->formatStateUsing(fn (bool $state) => $state ? 'Yes' : 'No')
|
||||
->color(fn (bool $state) => $state ? 'warning' : 'success'),
|
||||
TextEntry::make('permanent_closure')
|
||||
->label('Permanently Closed')
|
||||
->badge()
|
||||
->formatStateUsing(fn (bool $state) => $state ? 'Yes' : 'No')
|
||||
->color(fn (bool $state) => $state ? 'danger' : 'success'),
|
||||
IconEntry::make('is_supermarket')->boolean(),
|
||||
IconEntry::make('is_motorway_service_station')->boolean(),
|
||||
IconEntry::make('temporary_closure')->boolean()->trueColor('warning'),
|
||||
IconEntry::make('permanent_closure')->boolean()->trueColor('danger'),
|
||||
TextEntry::make('permanent_closure_date')->date()->placeholder('—'),
|
||||
TextEntry::make('last_seen_at')->dateTime('d M Y H:i'),
|
||||
])->columns(3),
|
||||
|
||||
Reference in New Issue
Block a user