UNPKG

@gechiui/components

Version:
32 lines (28 loc) 686 B
/** * GeChiUI dependencies */ import { link, linkOff } from '@gechiui/icons'; import { __ } from '@gechiui/i18n'; /** * Internal dependencies */ import Button from '../button'; import Tooltip from '../tooltip'; export default function LinkedButton( { isLinked, ...props } ) { const label = isLinked ? __( '解除等比例调整' ) : __( '等比例调整' ); return ( <Tooltip text={ label }> <span> <Button { ...props } className="component-box-control__linked-button" variant={ isLinked ? 'primary' : 'secondary' } isSmall icon={ isLinked ? link : linkOff } iconSize={ 16 } aria-label={ label } /> </span> </Tooltip> ); }