import React from 'react';
import { useTranslation } from 'react-i18next';
import { motion } from 'framer-motion';
import Loading from "../Loading";
import { ButtonWrap } from "./ButtonWrap";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
const Button = ({
  label,
  onClick,
  style,
  width: _width = 80,
  type: _type = 'default',
  loading
}) => {
  const {
    t
  } = useTranslation();
  return /*#__PURE__*/_jsx(ButtonWrap, {
    width: _width,
    type: _type,
    children: /*#__PURE__*/_jsxs(motion.div, {
      whileTap: {
        scale: 0.92
      },
      className: "buttonContainer",
      onClick: () => {
        onClick === null || onClick === void 0 ? void 0 : onClick();
      },
      style: style,
      children: [loading && /*#__PURE__*/_jsx(Loading, {}), t(label)]
    })
  });
};
export default Button;