UNPKG

@wulperstudio/cms

Version:
52 lines (51 loc) 2.21 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); var _react = _interopRequireDefault(require("react")); var _material = require("@mui/material"); var _styled = require("./styled"); var _jsxRuntime = require("react/jsx-runtime"); var _excluded = ["data", "paddingPanel", "containerProps", "accordionDetailsProps", "accordionSummaryProps"], _excluded2 = ["sx"]; /* eslint-disable react/no-array-index-key */ var Accordions = function Accordions(_ref) { var data = _ref.data, paddingPanel = _ref.paddingPanel, containerProps = _ref.containerProps, accordionDetailsProps = _ref.accordionDetailsProps, accordionSummaryProps = _ref.accordionSummaryProps, props = (0, _objectWithoutProperties2["default"])(_ref, _excluded); var _ref2 = accordionDetailsProps || {}, sxAccordionDetailsProps = _ref2.sx, restAccordionDetailsProps = (0, _objectWithoutProperties2["default"])(_ref2, _excluded2); return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, Object.assign({}, containerProps, { children: data.map(function (_ref3, i) { var header = _ref3.header, body = _ref3.body, expanded = _ref3.expanded, onChange = _ref3.onChange; return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styled.Accordion, Object.assign({ expanded: expanded, onChange: onChange }, props, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.AccordionSummary, Object.assign({ "aria-controls": "panel".concat(i, "-content"), id: "panel".concat(i, "-header") }, accordionSummaryProps, { children: header })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.AccordionDetails, Object.assign({ sx: Object.assign({ padding: paddingPanel }, sxAccordionDetailsProps) }, restAccordionDetailsProps, { children: body }))] }), i); }) })); }; var _default = exports["default"] = Accordions;