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/client/components/Header/HeaderIcon.tsx

24 lines
568 B

import { Box, Icon } from '@rocket.chat/fuselage';
import React, { FC, isValidElement, ReactElement } from 'react';
type HeaderIconProps = { icon: ReactElement | { name: string; color?: string } | null };
const HeaderIcon: FC<HeaderIconProps> = ({ icon }) =>
icon && (
<Box
display='flex'
flexShrink={0}
alignItems='center'
size={18}
overflow='hidden'
justifyContent='center'
>
{isValidElement(icon) ? (
icon
) : (
<Icon color='info' size='x18' {...{ name: (icon as any).name }} />
)}
</Box>
);
export default HeaderIcon;