Skip to content

Commit

Permalink
[NEW] New button for network outage (#25499)
Browse files Browse the repository at this point in the history
  • Loading branch information
amolghode1981 committed May 23, 2022
1 parent 2d40378 commit 94850a7
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit 94850a7

Please sign in to comment.