@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
82 lines (81 loc) • 3.73 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AssetTitleDescriptionBtn = void 0;
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _material = require("@mui/material");
var _jsxRuntime = require("react/jsx-runtime");
var _excluded = ["sx", "component"],
_excluded2 = ["variant", "component", "color", "fontWeight", "textAlign", "gutterBottom"],
_excluded3 = ["variant", "component", "color", "textAlign"];
var AssetTitleDescriptionBtn = exports.AssetTitleDescriptionBtn = function AssetTitleDescriptionBtn(_ref) {
var children = _ref.children,
asset = _ref.asset,
title = _ref.title,
description = _ref.description,
containerProps = _ref.containerProps,
containerTexts = _ref.containerTexts,
descriptionProps = _ref.descriptionProps,
titleProps = _ref.titleProps;
var _ref2 = containerProps || {},
sx = _ref2.sx,
_ref2$component = _ref2.component,
component = _ref2$component === void 0 ? 'article' : _ref2$component,
rest = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
var _ref3 = titleProps || {},
_ref3$variant = _ref3.variant,
variantTitle = _ref3$variant === void 0 ? 'h3' : _ref3$variant,
_ref3$component = _ref3.component,
componentTitle = _ref3$component === void 0 ? 'h3' : _ref3$component,
_ref3$color = _ref3.color,
colorTitle = _ref3$color === void 0 ? 'text.primary' : _ref3$color,
_ref3$fontWeight = _ref3.fontWeight,
fontWeightTitle = _ref3$fontWeight === void 0 ? 700 : _ref3$fontWeight,
_ref3$textAlign = _ref3.textAlign,
textAlignTitle = _ref3$textAlign === void 0 ? 'center' : _ref3$textAlign,
_ref3$gutterBottom = _ref3.gutterBottom,
gutterBottomTitle = _ref3$gutterBottom === void 0 ? true : _ref3$gutterBottom,
restTitleProps = (0, _objectWithoutProperties2["default"])(_ref3, _excluded2);
var _ref4 = descriptionProps || {},
_ref4$variant = _ref4.variant,
variantDescription = _ref4$variant === void 0 ? 'body1' : _ref4$variant,
_ref4$component = _ref4.component,
componentDescription = _ref4$component === void 0 ? 'p' : _ref4$component,
_ref4$color = _ref4.color,
colorDescription = _ref4$color === void 0 ? 'text.secondary' : _ref4$color,
_ref4$textAlign = _ref4.textAlign,
textAlignDescription = _ref4$textAlign === void 0 ? 'center' : _ref4$textAlign,
restDescriptionProps = (0, _objectWithoutProperties2["default"])(_ref4, _excluded3);
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, Object.assign({
sx: Object.assign({
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
gap: 3
}, sx),
component: component
}, rest, {
children: [asset, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, Object.assign({}, containerTexts, {
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, Object.assign({
component: componentTitle,
variant: variantTitle,
fontWeight: fontWeightTitle,
color: colorTitle,
textAlign: textAlignTitle,
gutterBottom: gutterBottomTitle
}, restTitleProps, {
children: title
})), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, Object.assign({
component: componentDescription,
variant: variantDescription,
color: colorDescription,
textAlign: textAlignDescription
}, restDescriptionProps, {
children: description
}))]
})), children]
}));
};