UNPKG

@wulperstudio/cms

Version:
59 lines 2.61 kB
import React from 'react'; import { v4 } from 'uuid'; import { useTheme } from '@mui/material'; import { WrapperBottomBar, WrapperOption, Text, CenterButton, WrapperCenterButton } from './styled'; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export var BottomBar = function BottomBar(props) { var theme = useTheme(); var _props$variant = props.variant, variant = _props$variant === void 0 ? 'float' : _props$variant, _props$isTextEnabled = props.isTextEnabled, isTextEnabled = _props$isTextEnabled === void 0 ? false : _props$isTextEnabled, options = props.options, _props$borderVariant = props.borderVariant, borderVariant = _props$borderVariant === void 0 ? 'middle' : _props$borderVariant, isDivider = props.isDivider, _props$indexFloat = props.indexFloat, indexFloat = _props$indexFloat === void 0 ? 3 : _props$indexFloat, _props$activeColor = props.activeColor, activeColor = _props$activeColor === void 0 ? theme.palette.primary.main : _props$activeColor, _props$floatIconColor = props.floatIconColor, floatIconColor = _props$floatIconColor === void 0 ? theme.palette.primary.main : _props$floatIconColor, _props$backgroundColo = props.backgroundColor, backgroundColor = _props$backgroundColo === void 0 ? theme.palette.background["default"] : _props$backgroundColo, _props$foregroundColo = props.foregroundColor, foregroundColor = _props$foregroundColo === void 0 ? theme.palette.background.paper : _props$foregroundColo; return /*#__PURE__*/_jsx(WrapperBottomBar, { backgroundColor: backgroundColor, isDivider: isDivider, children: options.map(function (_ref, i) { var icon = _ref.icon, text = _ref.text, toRoute = _ref.toRoute, active = _ref.active; if (i + 1 === indexFloat && variant === 'float') { return /*#__PURE__*/_jsx(WrapperCenterButton, { borderVariant: borderVariant, foregroundColor: foregroundColor, children: /*#__PURE__*/_jsxs(CenterButton, { onClick: toRoute, floatIconColor: floatIconColor, children: [icon, isTextEnabled && /*#__PURE__*/_jsx(Text, { children: text })] }) }, v4()); } return /*#__PURE__*/_jsxs(WrapperOption, { activeColor: activeColor, isTextEnabled: isTextEnabled, onClick: toRoute, active: active, children: [icon, isTextEnabled && /*#__PURE__*/_jsx(Text, { active: active, children: text })] }, v4()); }) }); };