Skip to content
Snippets Groups Projects
Unverified Commit 7dca05a9 authored by Guilherme Gazzo's avatar Guilherme Gazzo Committed by GitHub
Browse files

Chore: Omnichannel Sidebar icons alignment (#27501)

parent 7754f7af
No related branches found
No related tags found
No related merge requests found
import { Sidebar } from '@rocket.chat/fuselage';
import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
import { useEndpoint, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import type { ReactElement, ComponentProps } from 'react';
import React from 'react';
import { useOmnichannelAgentAvailable } from '../../../hooks/omnichannel/useOmnichannelAgentAvailable';
export const OmnichannelLivechatToggle = (): ReactElement => {
export const OmnichannelLivechatToggle = (props: Omit<ComponentProps<typeof Sidebar.TopBar.Action>, 'icon'>): ReactElement => {
const t = useTranslation();
const agentAvailable = useOmnichannelAgentAvailable();
const changeAgentStatus = useEndpoint('POST', '/v1/livechat/agent.status');
......@@ -22,6 +22,7 @@ export const OmnichannelLivechatToggle = (): ReactElement => {
return (
<Sidebar.TopBar.Action
{...props}
id={'omnichannel-status-toggle'}
data-tooltip={agentAvailable ? t('Turn_off_answer_chats') : t('Turn_on_answer_chats')}
color={agentAvailable ? 'success' : undefined}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment