"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = require("react");
var _getStepOrDecimals = (step, decimals) => {
  if (step != undefined) {
    if (!isNaN(step)) {
      return step;
    }
  }
  if (decimals != undefined) {
    if (!isNaN(decimals)) {
      return 1 / Math.pow(10, decimals);
    }
  }
  return undefined;
};
var useStepOrDecimals = (step, decimals) => {
  var [nStep, setNStep] = (0, _react.useState)(_getStepOrDecimals(step, decimals));
  (0, _react.useEffect)(() => {
    setNStep(_getStepOrDecimals(step, decimals));
  }, [step, decimals]);
  return nStep;
};
var _default = useStepOrDecimals;
exports.default = _default;