"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _react = _interopRequireDefault(require("react"));

var _components = require("@patternplate/components");

var _toggleButton = _interopRequireDefault(require("./common/toggle-button"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = CodeButton;
exports.default = _default;

function CodeButton(props) {
  return _react.default.createElement(StyledToggleButton, {
    enabled: props.enabled,
    shortcut: props.shortcut
  }, _react.default.createElement(StyledIcon, {
    enabled: props.enabled,
    symbol: "code"
  }), " ", props.shortcut.toString());
}

const COLOR = props => props.enabled ? props.theme.active : props.theme.color;

const StyledIcon = (0, _components.styled)(_components.Icon).withConfig({
  displayName: "toggle-code__StyledIcon"
})(["fill:", ";"], COLOR);
const StyledToggleButton = (0, _components.styled)(_toggleButton.default).withConfig({
  displayName: "toggle-code__StyledToggleButton"
})(["font-size:0;line-height:0;"]);
//# sourceMappingURL=toggle-code.js.map