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/client/components/UserAutoCompleteMultiple/UserAvatarChip.tsx

22 lines
677 B

import { Box, Chip, Icon } from '@rocket.chat/fuselage';
import { UserAvatar } from '@rocket.chat/ui-avatar';
import type { ComponentProps } from 'react';
type UserAvatarChipProps = ComponentProps<typeof Chip> & {
federated?: boolean;
username: string;
name?: string;
};
const UserAvatarChip = ({ federated, username, name, ...props }: UserAvatarChipProps) => {
return (
<Chip height='x20' {...props}>
{federated ? <Icon size='x20' name='globe' verticalAlign='middle' /> : <UserAvatar size='x20' username={username} />}
<Box is='span' margin='none' mis={4} verticalAlign='middle'>
{name ?? username}
</Box>
</Chip>
);
};
export default UserAvatarChip;