"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactI18next = require("react-i18next");
var _framerMotion = require("framer-motion");
var _Loading = _interopRequireDefault(require("../Loading"));
var _ButtonWrap = require("./ButtonWrap");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const Button = ({
  label,
  onClick,
  style,
  width: _width = 80,
  type: _type = 'default',
  loading
}) => {
  const {
    t
  } = (0, _reactI18next.useTranslation)();
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonWrap.ButtonWrap, {
    width: _width,
    type: _type,
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_framerMotion.motion.div, {
      whileTap: {
        scale: 0.92
      },
      className: "buttonContainer",
      onClick: () => {
        onClick === null || onClick === void 0 ? void 0 : onClick();
      },
      style: style,
      children: [loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.default, {}), t(label)]
    })
  });
};
var _default = Button;
exports.default = _default;