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/avatar/BaseAvatar.tsx

16 lines
453 B

import { Avatar, AvatarProps, Skeleton } from '@rocket.chat/fuselage';
import React, { FC, useState } from 'react';
export type BaseAvatarProps = Omit<AvatarProps, 'is'>;
const BaseAvatar: FC<BaseAvatarProps> = ({ size, ...props }) => {
const [error, setError] = useState<unknown>(false);
if (error) {
return <Skeleton variant='rect' {...props} />;
}
return <Avatar onError={setError} size={size} {...props} />;
};
export default BaseAvatar;