UNPKG

@wordpress/components

Version:
31 lines (29 loc) 795 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(_ref) { let { isLinked, ...props } = _ref; const label = isLinked ? __('Unlink sides') : __('Link sides'); return createElement(Tooltip, { text: label }, createElement(Button, _extends({}, props, { className: "component-box-control__linked-button", isSmall: true, icon: isLinked ? link : linkOff, iconSize: 24, "aria-label": label }))); } //# sourceMappingURL=linked-button.js.map