diff --git a/apps/meteor/client/sidebar/sections/components/OmnichannelCallToggleReady.tsx b/apps/meteor/client/sidebar/sections/components/OmnichannelCallToggleReady.tsx index 0b1da0fccb50..97b75a42ccac 100644 --- a/apps/meteor/client/sidebar/sections/components/OmnichannelCallToggleReady.tsx +++ b/apps/meteor/client/sidebar/sections/components/OmnichannelCallToggleReady.tsx @@ -31,10 +31,24 @@ export const OmnichannelCallToggleReady = (): ReactElement => { return t('Cannot_disable_while_on_call'); }; + const getIcon = (): 'phone-issue' | 'phone' | 'phone-disabled' => { + if (networkStatus === 'offline') { + return 'phone-issue'; + } + return registered ? 'phone' : 'phone-disabled'; + }; + + const getColor = (): 'warning' | 'success' | undefined => { + if (networkStatus === 'offline') { + return 'warning'; + } + return registered ? 'success' : undefined; + }; + const voipCallIcon = { title: getTooltip(), - color: registered ? 'success' : undefined, - icon: registered ? 'phone' : 'phone-disabled', + color: getColor(), + icon: getIcon(), } as const; useEffect(() => {