import React from 'react' ; import { useValues } from 'kea' ; import { EuiCallOut } from '@elastic/eui' ; import { DOCUMENT_CREATION_ERRORS , DOCUMENT_CREATION_WARNINGS } from '../constants' ; import { DocumentCreationLogic } from '../index' ; export const Errors = ( ) => { const { errors , warnings } = useValues ( DocumentCreationLogic ) ; return ( < > { errors . length > 0 && ( < EuiCallOut color = "danger" iconType = "alert" title = { DOCUMENT_CREATION_ERRORS . TITLE } > { errors . map ( ( message , index ) => ( < p key = { index } > { message } < /p>))} < /EuiCallOut>)} { warnings . length > 0 && ( < EuiCallOut color = "warning" iconType = "alert" title = { DOCUMENT_CREATION_WARNINGS . TITLE } > { warnings . map ( ( message , index ) => ( < p key = { index } > { message } < /p>))} < /EuiCallOut>)} < />); } ;