/** @format */ /** * External dependencies */ import { Dashicon, Popover } from '@wordpress/components'; import classnames from 'classnames'; import { uniqueId } from 'lodash'; import PropTypes from 'prop-types'; const DateInput = ( { value, onChange, dateFormat, label, describedBy, error } ) => { const classes = classnames( 'woocommerce-calendar__input', { 'is-empty': value.length === 0, 'is-error': error, } ); const id = uniqueId( '_woo-dates-input' ); return (
{ error && ( { error } ) }

{ error || describedBy }

); }; DateInput.propTypes = { value: PropTypes.string, onChange: PropTypes.func.isRequired, dateFormat: PropTypes.string.isRequired, label: PropTypes.string.isRequired, describedBy: PropTypes.string.isRequired, error: PropTypes.string, }; export default DateInput;