/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import { escapeHTML } from '@wordpress/escape-html';
const getErrorMessage = ( { message, type } ) => {
if ( ! message ) {
return __(
'An unknown error occurred which prevented the block from being updated.',
'woo-gutenberg-products-block'
);
}
if ( type === 'general' ) {
return (
{ __(
'The following error was returned',
'woo-gutenberg-products-block'
) }
{ escapeHTML( message ) }
);
}
if ( type === 'api' ) {
return (
{ __(
'The following error was returned from the API',
'woo-gutenberg-products-block'
) }
{ escapeHTML( message ) }
);
}
return message;
};
const ErrorMessage = ( { error } ) => (