/** @format */ /** * External dependencies */ import { Button } from '@wordpress/components'; import PropTypes from 'prop-types'; import classnames from 'classnames'; /** * Internal dependencies */ import './style.scss'; /** * A button useful for a launcher of a dropdown component. The button is 100% width of its container and displays * single or multiple lines rendered as `` elments. * * @param { object } props Props passed to component. * @return { object } - */ const DropdownButton = props => { const { labels, isOpen, ...otherProps } = props; const buttonClasses = classnames( 'woocommerce-dropdown-button', { 'is-open': isOpen, 'is-multi-line': labels.length > 1, } ); return ( ); }; DropdownButton.propTypes = { /** * An array of elements to be rendered as the content of the button. */ labels: PropTypes.array, /** * Boolean describing if the dropdown in open or not. */ isOpen: PropTypes.bool, }; export default DropdownButton;