"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.LinkingButton = void 0;
var _react = _interopRequireDefault(require("react"));
var _ToggleButton = _interopRequireDefault(require("../../../ToggleButton"));
var _wixUiIconsCommon = require("@wix/wix-ui-icons-common");
var _CornerRadiusInput = require("../../CornerRadiusInput.constants");
var _WixDesignSystemIconThemeProvider = require("../../../WixDesignSystemIconThemeProvider");
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/CornerRadiusInput/components/LinkingButton/LinkingButton.tsx";
var LinkingButton = _ref => {
  var {
    size,
    isLinkingEnabled,
    setLinking,
    linkingButtonLabels,
    onLinkedToggle
  } = _ref;
  var icons = (0, _WixDesignSystemIconThemeProvider.useIcons)('CornerRadiusInputLinkingButton', {
    LockUnlocked: _wixUiIconsCommon.LockUnlocked,
    LockLocked: _wixUiIconsCommon.LockLocked
  });
  return /*#__PURE__*/_react.default.createElement(_ToggleButton.default, {
    size: size,
    dataHook: _CornerRadiusInput.dataHooks.autoScaleButton,
    border: true,
    selected: isLinkingEnabled,
    labelValue: isLinkingEnabled ? linkingButtonLabels == null ? void 0 : linkingButtonLabels.pressed : linkingButtonLabels == null ? void 0 : linkingButtonLabels.unpressed,
    labelPlacement: "tooltip",
    onClick: () => {
      setLinking(prev => !prev);
      onLinkedToggle == null || onLinkedToggle(!isLinkingEnabled);
    },
    tooltipProps: {
      textAlign: 'center'
    },
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 29,
      columnNumber: 5
    }
  }, isLinkingEnabled ? /*#__PURE__*/_react.default.createElement(icons.LockLocked, {
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 48,
      columnNumber: 27
    }
  }) : /*#__PURE__*/_react.default.createElement(icons.LockUnlocked, {
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 48,
      columnNumber: 50
    }
  }));
};
exports.LinkingButton = LinkingButton;
//# sourceMappingURL=LinkingButton.js.map