import _extends from "@babel/runtime/helpers/esm/extends";
import React, { useContext } from 'react';
import { ThemeContext } from "../../../lib/theming/ThemeContext";
import { Button } from "../../Button";
import { useSizeControl } from "../../../lib/size/useSizeControl";
import { UndoIcon } from "../UndoIcon";
export var FxInputRestoreBtn = function FxInputRestoreBtn(props) {
  var theme = useContext(ThemeContext);
  var size = useSizeControl(props.size);
  var iconSizes = {
    small: parseInt(theme.inputIconSizeSmall),
    medium: parseInt(theme.inputIconSizeMedium),
    large: parseInt(theme.inputIconSizeLarge)
  };
  var cornersSizes = {
    small: {
      borderTopLeftRadius: theme.inputBorderRadiusSmall,
      borderBottomLeftRadius: theme.inputBorderRadiusSmall
    },
    medium: {
      borderTopLeftRadius: theme.inputBorderRadiusMedium,
      borderBottomLeftRadius: theme.inputBorderRadiusMedium
    },
    large: {
      borderTopLeftRadius: theme.inputBorderRadiusLarge,
      borderBottomLeftRadius: theme.inputBorderRadiusLarge
    }
  };
  var buttonCorners = cornersSizes[size];
  var iconUndo = /*#__PURE__*/React.createElement(UndoIcon, {
    size: iconSizes[size]
  });
  return /*#__PURE__*/(
    React.createElement(Button, {
      size: props.size,
      onClick: props.onRestore,
      borderless: props.borderless,
      disabled: props.disabled,
      corners: _extends({
        borderTopRightRadius: 0,
        borderBottomRightRadius: 0
      }, buttonCorners, props.corners),
      icon: iconUndo,
      "aria-label": props['aria-label']
    })
  );
};