UNPKG

@wordpress/components

Version:
33 lines (29 loc) 686 B
/** * 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 ( <Tooltip text={ label }> <span> <Button { ...props } className="component-box-control__linked-button" isPrimary={ isLinked } isSecondary={ ! isLinked } isSmall icon={ isLinked ? link : linkOff } iconSize={ 16 } aria-label={ label } /> </span> </Tooltip> ); }