@wordpress/block-editor
Version:
26 lines (24 loc) • 852 B
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import { createElement } from "@wordpress/element";
/**
* WordPress dependencies
*/
import { Button, Tooltip } from '@wordpress/components';
import { link, linkOff } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';
export default function LinkedButton({
isLinked,
...props
}) {
const label = isLinked ? __('Unlink radii') : __('Link radii'); // TODO: Remove span after merging https://github.com/WordPress/gutenberg/pull/44198
return createElement(Tooltip, {
text: label
}, createElement("span", null, createElement(Button, _extends({}, props, {
className: "component-border-radius-control__linked-button",
isSmall: true,
icon: isLinked ? link : linkOff,
iconSize: 24,
"aria-label": label
}))));
}
//# sourceMappingURL=linked-button.js.map