);
}
render() {
if ( this.props.isPreview ) {
return this.renderEdit();
}
return this.renderView();
}
}
ProductSearchBlock.propTypes = {
/**
* The attributes for this block.
*/
attributes: PropTypes.object.isRequired,
/**
* A unique ID for identifying the label for the select dropdown.
*/
instanceId: PropTypes.number,
/**
* Whether this is the block preview or frontend display.
*/
isPreview: PropTypes.bool,
/**
* A callback to update attributes.
*/
setAttributes: PropTypes.func,
};
export default compose( [ withInstanceId ] )( ProductSearchBlock );