UNPKG

@wordpress/components

Version:
32 lines (30 loc) 852 B
import _extends from "@babel/runtime/helpers/esm/extends"; import { createElement } from "@wordpress/element"; /** * WordPress dependencies */ import { link, linkOff } from '@wordpress/icons'; import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ import Button from '../button'; import Tooltip from '../tooltip'; export default function LinkedButton({ isLinked, ...props }) { const label = isLinked ? __('Unlink Sides') : __('Link Sides'); return createElement(Tooltip, { text: label }, createElement("span", null, createElement(Button, _extends({}, props, { className: "component-box-control__linked-button", isPrimary: isLinked, isSecondary: !isLinked, isSmall: true, icon: isLinked ? link : linkOff, iconSize: 16, "aria-label": label })))); } //# sourceMappingURL=linked-button.js.map