pleroma/app/soapbox/features/placeholder/components/placeholder_avatar.js

30 lines
516 B
JavaScript
Raw Normal View History

import PropTypes from 'prop-types';
2022-03-21 11:09:01 -07:00
import * as React from 'react';
2022-03-21 11:09:01 -07:00
const PlaceholderAvatar = ({ size }) => {
const style = React.useMemo(() => {
if (!size) {
return {};
}
2022-03-21 11:09:01 -07:00
return {
width: `${size}px`,
height: `${size}px`,
};
2022-03-21 11:09:01 -07:00
}, [size]);
return (
<div
2022-03-23 17:18:37 -07:00
className='rounded-full bg-slate-200 dark:bg-slate-700'
2022-03-21 11:09:01 -07:00
style={style}
alt=''
/>
);
};
2022-03-21 11:09:01 -07:00
PlaceholderAvatar.propTypes = {
size: PropTypes.number.isRequired,
};
2022-03-21 11:09:01 -07:00
export default PlaceholderAvatar;