2022-01-10 14:17:52 -08:00
|
|
|
import PropTypes from 'prop-types';
|
2022-03-21 11:09:01 -07:00
|
|
|
import * as React from 'react';
|
2021-10-11 12:00:59 -07:00
|
|
|
|
2022-03-21 11:09:01 -07:00
|
|
|
const PlaceholderAvatar = ({ size }) => {
|
|
|
|
const style = React.useMemo(() => {
|
|
|
|
if (!size) {
|
|
|
|
return {};
|
|
|
|
}
|
2021-10-11 12:00:59 -07:00
|
|
|
|
2022-03-21 11:09:01 -07:00
|
|
|
return {
|
2021-10-11 12:00:59 -07:00
|
|
|
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=''
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
2021-10-11 12:00:59 -07:00
|
|
|
|
2022-03-21 11:09:01 -07:00
|
|
|
PlaceholderAvatar.propTypes = {
|
|
|
|
size: PropTypes.number.isRequired,
|
|
|
|
};
|
2021-10-11 12:00:59 -07:00
|
|
|
|
2022-03-21 11:09:01 -07:00
|
|
|
export default PlaceholderAvatar;
|