@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
62 lines • 2.54 kB
JavaScript
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["src", "size"],
_excluded2 = ["direction"],
_excluded3 = ["variant", "gutterBottom"],
_excluded4 = ["variant"];
import React from 'react';
import { Box, Stack, Typography, useTheme } from '@mui/material';
import { AvatarV2 } from '../AvatarV2';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
var AvatarTitleDescription = function AvatarTitleDescription(_ref) {
var title = _ref.title,
description = _ref.description,
avatarProps = _ref.avatarProps,
columnGap = _ref.columnGap,
colorTitle = _ref.colorTitle,
containerProps = _ref.containerProps,
descriptionProps = _ref.descriptionProps,
textContainerProps = _ref.textContainerProps,
titleProps = _ref.titleProps;
var theme = useTheme();
var _ref2 = avatarProps || {},
src = _ref2.src,
_ref2$size = _ref2.size,
size = _ref2$size === void 0 ? 'medium' : _ref2$size,
rest = _objectWithoutProperties(_ref2, _excluded);
var _ref3 = containerProps || {},
_ref3$direction = _ref3.direction,
direction = _ref3$direction === void 0 ? 'row' : _ref3$direction,
restPropsContainer = _objectWithoutProperties(_ref3, _excluded2);
var _ref4 = titleProps || {},
_ref4$variant = _ref4.variant,
variant = _ref4$variant === void 0 ? 'h4' : _ref4$variant,
gutterBottom = _ref4.gutterBottom,
restTitleProps = _objectWithoutProperties(_ref4, _excluded3);
var _ref5 = descriptionProps || {},
_ref5$variant = _ref5.variant,
variantDescription = _ref5$variant === void 0 ? 'body2' : _ref5$variant,
restDescriptionProps = _objectWithoutProperties(_ref5, _excluded4);
return /*#__PURE__*/_jsxs(Stack, Object.assign({
direction: direction,
columnGap: columnGap || 2
}, restPropsContainer, {
children: [/*#__PURE__*/_jsx(AvatarV2, Object.assign({
size: size,
src: src
}, rest)), /*#__PURE__*/_jsxs(Box, Object.assign({}, textContainerProps, {
children: [/*#__PURE__*/_jsx(Typography, Object.assign({
variant: variant,
color: colorTitle || theme.palette.text.primary,
gutterBottom: gutterBottom
}, restTitleProps, {
children: title
})), /*#__PURE__*/_jsx(Typography, Object.assign({
variant: variantDescription,
color: colorTitle || theme.palette.text.secondary
}, restDescriptionProps, {
children: description
}))]
}))]
}));
};
export default AvatarTitleDescription;