bigbuffet-rw/app/soapbox/features/placeholder/components/placeholder_avatar.tsx
2022-05-01 12:45:37 -05:00

28 lines
527 B
TypeScript

import * as React from 'react';
interface IPlaceholderAvatar {
size: number,
}
/** Fake avatar to display while data is loading. */
const PlaceholderAvatar: React.FC<IPlaceholderAvatar> = ({ size }) => {
const style = React.useMemo(() => {
if (!size) {
return {};
}
return {
width: `${size}px`,
height: `${size}px`,
};
}, [size]);
return (
<div
className='rounded-full bg-slate-200 dark:bg-slate-700'
style={style}
/>
);
};
export default PlaceholderAvatar;