Colorchange on Stateupdate not working in Infolist

Hi - I got an infolist that is filled via the state-function. When I update the state via an action like this:
->action(function () { $state = $this->infolist->getState();
$state['connection']['status'] = 'online';
$this->infolist->state($state);
})
->action(function () { $state = $this->infolist->getState();
$state['connection']['status'] = 'online';
$this->infolist->state($state);
})
The according IconEntry that handles connection.status updates it's icon, but not it's color. What can I do to acchieve this? Here is the IconEntry-Code:
IconEntry::make('connection.status')
->label('')
->alignCenter()
->icon(fn($state): string => match($state){
'unknown' => 'tabler-help-square',
'online' => 'tabler-square-check'
})
->color(fn(string $state): string => match($state){
'online' => 'success',
'unknown' => 'gray',
})->columnSpan(1),
IconEntry::make('connection.status')
->label('')
->alignCenter()
->icon(fn($state): string => match($state){
'unknown' => 'tabler-help-square',
'online' => 'tabler-square-check'
})
->color(fn(string $state): string => match($state){
'online' => 'success',
'unknown' => 'gray',
})->columnSpan(1),
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server