@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
69 lines • 1.93 kB
JavaScript
/* eslint-disable react/no-unused-prop-types */
import React from 'react';
import { Avatar, useTheme } from '@mui/material';
import { Chip } from '../../components/Chip';
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
export var RenderTextTotal = function RenderTextTotal(_ref) {
var total = _ref.total,
setShowPlaceholder = _ref.setShowPlaceholder;
React.useEffect(function () {
if (total > 0) {
setShowPlaceholder(false);
} else {
setShowPlaceholder(true);
}
return function () {
setShowPlaceholder(true);
};
}, [total, setShowPlaceholder]);
return /*#__PURE__*/_jsxs("span", {
children: [total, ' ', "selected"]
});
};
export var RenderTagChip = function RenderTagChip(_ref2) {
var label = _ref2.label;
var theme = useTheme();
return /*#__PURE__*/_jsx(Chip, {
size: "medium",
label: label,
chipProps: {
sx: {
color: theme.palette.primary.main,
backgroundColor: theme.palette.primary.light,
fontSize: '16px',
fontWeight: '500',
mr: 1
}
}
});
};
var RenderTagChipAvatarBase = function RenderTagChipAvatarBase(_ref3) {
var label = _ref3.label,
avatarImg = _ref3.avatarImg,
ref = _ref3.ref,
_AvatarProps = _ref3.AvatarProps;
var theme = useTheme();
return /*#__PURE__*/_jsx(Chip, {
size: "medium",
label: label,
chipProps: {
avatar: /*#__PURE__*/_jsx(Avatar, Object.assign({
alt: "user",
src: avatarImg
}, _AvatarProps)),
ref: ref,
sx: {
color: theme.palette.primary.main,
fontSize: '12px',
fontWeight: '500',
mr: 1,
backgroundColor: theme.palette.primary.light
}
}
});
};
export var RenderTagChipAvatar = /*#__PURE__*/React.forwardRef(function (props, ref) {
return /*#__PURE__*/_jsx(RenderTagChipAvatarBase, Object.assign({}, props, {
ref: ref
}));
});