IconEntry not showing icon if value is null

I have an IconEntry that I want to use to display if something is ok or not. But if the value is null, it doesn't show up.
Here's a code example:
IconEntry::make('apple_id')
                            ->label('Apple login')
                            ->icon(fn (string $state): string => !empty($state) ? 'heroicon-o-check-circle' : 'heroicon-o-x-circle')
                            ->color(fn (string $state): string => !empty($state) ? 'success' : 'danger'),


If it's null I want it to display the red x mark but it just isn't processed. Any workaround?
Was this page helpful?