UNPKG

@s-ui/react-atom-button

Version:
18 lines 661 B
import PropTypes from 'prop-types'; import { CLASS, ICON_POSITIONS, isAtomIcon, prepareAtomIcon, SIZES } from './config.js'; import { jsx as _jsx } from "react/jsx-runtime"; var ButtonIcon = function ButtonIcon(_ref) { var children = _ref.children, position = _ref.position, size = _ref.size; if (!children) return null; // if the icon is an AtomIcon, we've to be sure the correct props are used var iconToRender = isAtomIcon(children) ? prepareAtomIcon(children, { size: size }) : children; return /*#__PURE__*/_jsx("span", { className: CLASS + "-" + position + "Icon", children: iconToRender }); }; export default ButtonIcon;