I am struggling with displaying icons in my TypeScript code using Material Icons. I need to dynamically change the icon based on a condition, for example if the power is false I want to display 'power_off', but if it's true then I want to display 'power'. I tried using another component to handle this logic, but even though the name of the icon changes in that component, it doesn't reflect the change in the view. Can someone please assist me with this issue? Thank you.
{name: 'associateDriver', visible: true, tooltip: 'Associate Driver', icon: 'person', type: 'icon'},
{name: 'associateServiceReminder', visible: true, tooltip: 'Service Reminder', icon: 'add_alert', type: 'icon'},
{name: 'busStopStatus', visible: false, tooltip: 'Bus Stop Status', icon: 'pin_drop', type: 'icon'},
{name: 'delete', visible: false, tooltip: 'Delete', icon: 'delete', type: 'icon'},
{name: 'immobilize', visible: true, tooltip: 'Immobilize', icon: 'power_off', type: 'icon'}