File "index.js"

Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/better-wp-security/core/packages/ui/src/result-summary/index.js
File size: 800 bytes
MIME-type: text/x-java
Charset: utf-8

/**
 * Solid dependencies
 */
import { MessageList } from '@ithemes/ui';

/**
 * Internal dependencies
 */
import { ErrorList } from '../';

export default function ResultSummary( {
	result,
	hasBorder,
	schemaError,
	errors,
} ) {
	return (
		<>
			<ErrorList
				apiError={ result?.error }
				schemaError={ schemaError }
				errors={ errors }
				hasBorder={ hasBorder }
			/>
			{ result?.success && (
				<MessageList
					messages={ result.success }
					type="success"
					hasBorder={ hasBorder }
				/>
			) }
			{ result?.warning && (
				<MessageList
					messages={ result.warning }
					type="warning"
					hasBorder={ hasBorder }
				/>
			) }
			{ result?.info && (
				<MessageList
					messages={ result.info }
					type="info"
					hasBorder={ hasBorder }
				/>
			) }
		</>
	);
}