The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/ee/client/hooks/useDevicesMenuOption.tsx

31 lines
901 B

import { Box, Icon } from '@rocket.chat/fuselage';
import { useSetModal, useTranslation } from '@rocket.chat/ui-contexts';
import type { ReactNode } from 'react';
import React from 'react';
import DeviceSettingsModal from '../voip/modals/DeviceSettingsModal';
import { useHasLicenseModule } from './useHasLicenseModule';
type DevicesMenuOption = {
type?: 'option' | 'heading' | 'divider';
label?: ReactNode;
action?: () => void;
};
export const useDevicesMenuOption = (): DevicesMenuOption | null => {
const isEnterprise = useHasLicenseModule('voip-enterprise');
const t = useTranslation();
const setModal = useSetModal();
const option = {
label: (
<Box alignItems='center' display='flex'>
<Icon mie='x4' name='customize' size='x16' />
{t('Device_settings')}
</Box>
),
action: (): void => setModal(<DeviceSettingsModal />),
};
return isEnterprise ? option : null;
};