@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
64 lines • 2.26 kB
JavaScript
var _Icon, _Icon2;
import React from 'react';
import { Typography, Stack, InputLabel } from '@mui/material';
import { Icon } from '@iconify/react';
import { IconButtonComponent } from '../IconButtonComponent';
import { CustomFormControl, ContainerCounter } from './styled';
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
var InputCounter = function InputCounter(props) {
return /*#__PURE__*/_jsxs(_Fragment, {
children: [/*#__PURE__*/_jsx(InputLabel, {
sx: {
marginBottom: '5px',
fontSize: '16px',
fontWeight: 'bold',
fontFamily: 'Poppins, cursive'
},
children: props.label
}), /*#__PURE__*/_jsx(CustomFormControl, {
variant: "filled",
fullWidth: true,
sx: {
backgroundColor: '#F6F7FC',
borderRadius: '10px',
minWidth: 0
},
children: /*#__PURE__*/_jsxs(ContainerCounter, {
children: [/*#__PURE__*/_jsx(Typography, {
variant: "body1",
component: "p",
color: "textSecondary",
children: props.title
}), /*#__PURE__*/_jsxs(Stack, {
spacing: 2,
direction: "row",
alignItems: "center",
children: [/*#__PURE__*/_jsx(IconButtonComponent, {
iconProps: {
onClick: function onClick() {
var _props$setNumber;
return (_props$setNumber = props.setNumber) == null ? void 0 : _props$setNumber.call(props, props.number - 1);
}
},
children: _Icon || (_Icon = /*#__PURE__*/_jsx(Icon, {
icon: "mdi:minus"
}))
}), /*#__PURE__*/_jsx("span", {
children: props.number
}), /*#__PURE__*/_jsx(IconButtonComponent, {
iconProps: {
onClick: function onClick() {
var _props$setNumber2;
return (_props$setNumber2 = props.setNumber) == null ? void 0 : _props$setNumber2.call(props, props.number + 1);
}
},
children: _Icon2 || (_Icon2 = /*#__PURE__*/_jsx(Icon, {
icon: "mdi:plus"
}))
})]
})]
})
})]
});
};
export default InputCounter;