import type { IOmnichannelSourceFromApp } from '@rocket.chat/core-typings'; import { Icon, Box } from '@rocket.chat/fuselage'; import type { ComponentProps } from 'react'; import { useOmnichannelRoomIcon } from './context/OmnichannelRoomIconContext'; export type OmnichannelAppSourceRoomIconProps = { source: IOmnichannelSourceFromApp; color: ComponentProps['color']; size: ComponentProps['size']; placement: 'sidebar' | 'default'; }; export const OmnichannelAppSourceRoomIcon = ({ source, color, size, placement }: OmnichannelAppSourceRoomIconProps) => { const icon = (placement === 'sidebar' && source.sidebarIcon) || source.defaultIcon; const value = useOmnichannelRoomIcon(source.id, icon || ''); if (!value) { return ; } return ( ); };