import _extends from "@babel/runtime/helpers/esm/extends";
import React, { forwardRef, useMemo } from "react";
import { InputAdornment } from "./InputAdornment";
import { InputNumber } from "./InputNumber";
import { Typography } from "../Typography/Typography";
export const InputCurrency = /*#__PURE__*/forwardRef((_ref, ref) => {
  let {
    currency,
    size,
    startAdornment,
    endAdornment,
    disabled,
    ...rest
  } = _ref;
  const variant = useMemo(() => {
    if (size === "biggest") {
      return "Header 2";
    }
    if (size === "big") {
      return "Body 1";
    }
    return "Body 2";
  }, [size]);
  const weight = useMemo(() => {
    return size === "biggest" ? "bold" : "regular";
  }, [size]);
  return /*#__PURE__*/React.createElement(InputNumber, _extends({
    size: size,
    align: "right",
    ref: ref,
    disabled: disabled,
    shortenThreshold: 10000,
    endAdornment: endAdornment && /*#__PURE__*/React.createElement(InputAdornment, {
      disablePointerEvents: disabled
    }, endAdornment)
  }, rest, {
    startAdornment: /*#__PURE__*/React.createElement(InputAdornment, {
      disablePointerEvents: disabled
    }, /*#__PURE__*/React.createElement(Typography, {
      variant: variant,
      weight: weight
    }, currency), startAdornment)
  }));
});
InputCurrency.displayName = "InputCurrency";
//# sourceMappingURL=InputCurrency.js.map