@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
51 lines • 1.43 kB
JavaScript
import React from 'react';
import { Badge, styled } from '@mui/material';
import { CustomAvatar } from './styled';
import { stringAvatar } from './utils';
import { jsx as _jsx } from "react/jsx-runtime";
var Avatar = function Avatar(props) {
var StyledBadge = styled(Badge)(function () {
return {
'& span': {
height: '15px',
minWidth: '15px'
}
};
});
if (!props.isImage) {
return /*#__PURE__*/_jsx(StyledBadge, {
color: "secondary",
invisible: props.invisibleBadge,
badgeContent: props.badgeContent,
showZero: props.showZero,
variant: "dot",
anchorOrigin: {
vertical: 'bottom',
horizontal: 'right'
},
children: /*#__PURE__*/_jsx(CustomAvatar, Object.assign({}, stringAvatar(props.text), props.avatarProps, {
minHeight: props.minHeight,
minWidth: props.minWidth
}))
});
}
return /*#__PURE__*/_jsx(StyledBadge, {
color: "secondary",
invisible: props.invisibleBadge,
badgeContent: props.badgeContent,
anchorOrigin: {
vertical: 'bottom',
horizontal: 'right'
},
showZero: props.showZero,
overlap: "circular",
variant: "standard",
children: /*#__PURE__*/_jsx(CustomAvatar, Object.assign({
src: props.urlImg
}, props.avatarProps, {
minHeight: props.minHeight,
minWidth: props.minWidth
}))
});
};
export default Avatar;