/** @format */ /** * External dependencies */ import { __ } from '@wordpress/i18n'; import { Icon } from '@wordpress/components'; import { Component } from '@wordpress/element'; /** * Internal dependencies */ import { MenuItem } from '@woocommerce/components'; class SectionControls extends Component { constructor( props ) { super( props ); this.onMoveUp = this.onMoveUp.bind( this ); this.onMoveDown = this.onMoveDown.bind( this ); } onMoveUp() { const { onMove, onToggle } = this.props; onMove( -1 ); // Close the dropdown onToggle(); } onMoveDown() { const { onMove, onToggle } = this.props; onMove( 1 ); // Close the dropdown onToggle(); } render() { const { onRemove, isFirst, isLast } = this.props; return (
{ ! isFirst && ( { __( 'Move up', 'woocommerce-admin' ) } ) } { ! isLast && ( { __( 'Move Down', 'woocommerce-admin' ) } ) } { __( 'Remove section', 'woocommerce-admin' ) }
); } } export default SectionControls;