@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
65 lines • 2.31 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["type"];
/* eslint-disable react/no-array-index-key */
/* eslint-disable react/prop-types */
import React from 'react';
import { Stack, useTheme } from '@mui/material';
import { Box, Label } from './styled';
import { IconButtonComponent } from '../IconButtonComponent';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
var IconButtonOutput = function IconButtonOutput(props) {
var theme = useTheme();
return /*#__PURE__*/_jsxs(Box, {
showBorder: props.showBorder,
backgroundColor: props.backgroundColor,
showBoxShadow: props.showBoxShadow,
showDivider: props.showDivider,
children: [props.label && /*#__PURE__*/_jsx(Label, {
children: props.label
}), /*#__PURE__*/_jsx(Stack, _extends({
direction: "row",
spacing: "10px",
sx: {
width: '100%',
overflow: 'auto',
p: 1
}
}, props.BoxIconsProps, {
children: props.listIcon && props.listIcon.map(function (_ref, i) {
var _ref$type = _ref.type,
type = _ref$type === void 0 ? 'url' : _ref$type,
item = _objectWithoutProperties(_ref, _excluded);
return /*#__PURE__*/_jsxs("div", {
children: [type === 'url' && /*#__PURE__*/_jsx("a", {
href: item.url,
target: "_blank",
rel: "noreferrer",
style: {
textDecoration: 'none',
color: 'unset'
},
children: /*#__PURE__*/_jsx(IconButtonComponent, {
iconProps: _extends({
onClick: item.onClick,
sx: {
boxShadow: theme.shadows[1]
}
}, props.iconProps, item.iconProps),
children: item.icon
})
}), type === 'button' && /*#__PURE__*/_jsx(IconButtonComponent, {
iconProps: _extends({
onClick: item.onClick,
sx: {
boxShadow: theme.shadows[1]
}
}, props.iconProps, item.iconProps),
children: item.icon
})]
}, i);
})
}))]
});
};
export default IconButtonOutput;