UNPKG

@wulperstudio/cms

Version:
67 lines 2.09 kB
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; var _excluded = ["sx", "src"]; import React from 'react'; import { v4 } from 'uuid'; import { Box, Stack, Typography, useTheme } from '@mui/material'; import { AvatarV2 } from '../../components'; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export var MenuSettings = function MenuSettings(_ref) { var title = _ref.title, hideAvatar = _ref.hideAvatar, options = _ref.options, urlAvatar = _ref.urlAvatar, boxProps = _ref.boxProps, AvatarProps = _ref.AvatarProps; var theme = useTheme(); var _ref2 = AvatarProps || {}, sx = _ref2.sx, _ref2$src = _ref2.src, src = _ref2$src === void 0 ? urlAvatar : _ref2$src, rest = _objectWithoutProperties(_ref2, _excluded); return /*#__PURE__*/_jsx(Box, Object.assign({ width: "100%", sx: { height: '100%', overFlowY: 'auto' } }, boxProps, { children: /*#__PURE__*/_jsxs(Stack, { rowGap: "1.5rem", children: [!hideAvatar && /*#__PURE__*/_jsx(Stack, { direction: "row", alignItems: "center", justifyContent: "center", children: /*#__PURE__*/_jsx(AvatarV2, Object.assign({ src: src, sx: Object.assign({ minWidth: 120, minHeight: 120 }, sx) }, rest)) }), title && /*#__PURE__*/_jsx(Stack, { direction: "row", alignItems: "center", justifyContent: "center", children: /*#__PURE__*/_jsx(Typography, { color: theme.palette.text.primary, fontSize: "25px", fontWeight: "600", children: title }) }), /*#__PURE__*/_jsx(Stack, { rowGap: "15px", alignItems: "flex-start", justifyContent: "center", sx: { maxWidth: 'fit-content', margin: '0 auto' }, children: options.map(function (op) { return /*#__PURE__*/_jsx(Box, { children: op.item }, v4()); }) })] }) })); };