import React, { memo } from 'react';
import Button from './button';
var CompactButton = function CompactButton(_ref) {
  var _ref$to = _ref.to,
    to = _ref$to === void 0 ? '/' : _ref$to,
    children = _ref.children,
    iconRight = _ref.iconRight,
    icon = _ref.icon,
    _ref$scale = _ref.scale,
    scale = _ref$scale === void 0 ? 2 / 3 : _ref$scale,
    type = _ref.type,
    style = _ref.style,
    a = _ref.a,
    target = _ref.target,
    onClick = _ref.onClick;
  if (a) {
    return /*#__PURE__*/React.createElement("a", {
      style: {
        all: 'unset',
        boxSizing: 'border-box',
        display: 'inline-block',
        lineHeight: 'calc(2.5* 16px)',
        fontWeight: '400',
        fontSize: 'calc(0.875* 16px)',
        textAlign: 'center',
        whiteSpace: 'nowrap',
        position: 'relative',
        overflow: 'hidden',
        color: '#666',
        backgroundColor: '#fff',
        cursor: 'pointer',
        minWidth: 'min-content',
        width: 'auto',
        height: 'calc(2.5* 16px)',
        padding: '0 calc(0.69* 16px) 0 calc(0.69* 16px)',
        margin: 0,
        '--helpdice-ui-button-height': 'calc(2.5* 16px)',
        '--helpdice-ui-button-icon-padding': 'calc(0.4362* 16px)'
      },
      href: to,
      target: target
    }, /*#__PURE__*/React.createElement("span", {
      style: {
        position: 'absolute',
        right: 'auto',
        left: 'var(--helpdice-ui-button-icon-padding)',
        top: '50%',
        transform: 'translateY(-50%)',
        display: 'flex',
        justifyContent: 'center',
        alignItems: 'center',
        color: 'var(--helpdice-ui-button-color)',
        zIndex: 1
      }
    }, icon), /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'inline-flex',
        position: 'relative',
        zIndex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        textAlign: 'center',
        lineHeight: 'inherit',
        paddingLeft: icon ? 'calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding)* .5)' : 0
      }
    }, children));
  }
  return /*#__PURE__*/React.createElement(Button, {
    icon: icon,
    style: style,
    type: type,
    onClick: onClick,
    auto: true,
    scale: scale,
    px: 0.6,
    iconRight: iconRight
  }, children);
};
export default /*#__PURE__*/memo(CompactButton);