UNPKG

@wordpress/components

Version:
33 lines (32 loc) 1 kB
/** * WordPress dependencies */ import { link, linkOff } from '@wordpress/icons'; import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ import Button from '../../button'; import { contextConnect } from '../../context'; import { useBorderBoxControlLinkedButton } from './hook'; import { jsx as _jsx } from "react/jsx-runtime"; const BorderBoxControlLinkedButton = (props, forwardedRef) => { const { className, isLinked, ...buttonProps } = useBorderBoxControlLinkedButton(props); const label = isLinked ? __('Unlink sides') : __('Link sides'); return /*#__PURE__*/_jsx(Button, { ...buttonProps, size: "small", icon: isLinked ? link : linkOff, iconSize: 24, label: label, ref: forwardedRef, className: className }); }; const ConnectedBorderBoxControlLinkedButton = contextConnect(BorderBoxControlLinkedButton, 'BorderBoxControlLinkedButton'); export default ConnectedBorderBoxControlLinkedButton; //# sourceMappingURL=component.js.map