@gechiui/block-editor
Version:
26 lines (24 loc) • 594 B
JavaScript
/**
* GeChiUI dependencies
*/
import { __ } from '@gechiui/i18n';
import { UnitControl } from '@gechiui/components';
/**
* Internal dependencies
*/
import { BASE_DEFAULT_VALUE, STEP, isLineHeightDefined } from './utils';
export default function LineHeightControl( { value: lineHeight, onChange } ) {
const isDefined = isLineHeightDefined( lineHeight );
const value = isDefined ? lineHeight : BASE_DEFAULT_VALUE;
return (
<UnitControl
label={ __( 'Line Height' ) }
min={ 0 }
max={ 5 }
step={ STEP }
value={ value }
onChange={ onChange }
units={ false }
/>
);
}