import { isEnabled } from '@automattic/calypso-config'; import { Button } from '@automattic/components'; import { localizeUrl } from '@automattic/i18n-utils'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { WPImportError, FileTooLarge } from 'calypso/blocks/importer/wordpress/types'; import InlineSupportLink from 'calypso/components/inline-support-link'; import Notice from 'calypso/components/notice'; import { addQueryArgs } from 'calypso/lib/route'; const noop = () => {}; class ImporterError extends PureComponent { static displayName = 'ImporterError'; static defaultProps = { retryImport: noop, }; static propTypes = { description: PropTypes.string.isRequired, type: PropTypes.string.isRequired, retryImport: PropTypes.func, siteSlug: PropTypes.string, code: PropTypes.string, importerEngine: PropTypes.string, }; contactSupport = ( event ) => { event.preventDefault(); event.stopPropagation(); window.open( '/help', '_blank', 'noopener,noreferrer' ); }; installPlugin = ( event ) => { event.preventDefault(); event.stopPropagation(); window.location.href = '/plugins/all-in-one-wp-migration'; }; everythingImport = ( event ) => { event.preventDefault(); event.stopPropagation(); window.location.href = addQueryArgs( { siteSlug: this.props.siteSlug }, '/setup/site-setup/import' ); }; getImportError = () => { return this.props.translate( '%(errorDescription)s{{br/}}{{a}}Try again{{/a}} or {{cs}}get help{{/cs}}.', { args: { errorDescription: this.props.description, }, components: { a: