{"version":3,"file":"static/js/836.22efa278.chunk.js","mappings":"6RAWA,MAkDA,EAlD8CA,KAC1C,MAAM,EAAEC,IAAMC,EAAAA,EAAAA,KACRC,GAAWC,EAAAA,EAAAA,OACVC,EAAWC,IAAgBC,EAAAA,EAAAA,WAAS,GACrCC,GAAWC,EAAAA,EAAAA,KAAaC,GAA6BA,EAAMC,GAAGH,WAC9DI,GAAoBH,EAAAA,EAAAA,KAAaC,GAA6BA,EAAMC,GAAGE,gBAE7EC,EAAAA,EAAAA,YAAU,KACFN,GAAUF,GAAa,EAAK,GACjC,CAACE,IAEJ,MAKMO,EAAcP,GAAWQ,EAAAA,EAAAA,KAACC,EAAAA,EAAS,CAAAC,SAAEjB,EAAE,GAAGO,QAA2BQ,EAAAA,EAAAA,KAACG,EAAAA,SAAc,IACpFC,EAAUR,GACZI,EAAAA,EAAAA,KAACC,EAAAA,EAAS,CAAAC,SACLN,EAAkBS,MAAM,MAAMC,KAAI,CAACC,EAAMC,KACtCC,EAAAA,EAAAA,MAACN,EAAAA,SAAc,CAAAD,SAAA,CACVK,GACDP,EAAAA,EAAAA,KAAA,WAFiBQ,QAO7BR,EAAAA,EAAAA,KAACG,EAAAA,SAAc,IAGnB,OACIM,EAAAA,EAAAA,MAACC,EAAAA,EAAK,CACFC,UAAQ,EACRC,QAASvB,EACTwB,cAAc,EACdC,UAAU,EACVC,OAAQ,EACJf,EAAAA,EAAAA,KAACgB,EAAAA,GAAQ,CAAUC,QA1BVC,KACjB/B,EAASgC,EAAAA,GAAUC,cACnB9B,GAAa,EAAM,EAwB8BY,UACrCF,EAAAA,EAAAA,KAACqB,EAAAA,EAAI,CAAAnB,SAAEjB,EAAE,WADC,OAIlBqC,UAAU,cAAapB,SAAA,EAEvBF,EAAAA,EAAAA,KAACuB,EAAAA,EAAO,CAACC,MAAOC,EAAAA,EAAYC,IAAIxB,SAAEjB,EAAE,0BACnCc,EACAK,IACG,C","sources":["components/error-display/error-display.tsx"],"sourcesContent":["import { Modal } from 'antd';\r\nimport Paragraph from 'antd/lib/typography/Paragraph';\r\nimport Text from 'antd/lib/typography/Text';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport ZLButton from '../zl-button/zl-button';\r\nimport Heading, { HeadingSize } from '../heading/heading';\r\nimport { IApplicationState } from '../../store';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { actionCreators as UIActions } from '../../store/UI';\r\n\r\nconst ErrorDisplay: React.FunctionComponent = () => {\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const [showModal, setShowModal] = useState(false);\r\n const errorKey = useSelector((state: IApplicationState) => state.ui.errorKey);\r\n const additionalMessage = useSelector((state: IApplicationState) => state.ui.errorMessage);\r\n\r\n useEffect(() => {\r\n if (errorKey) setShowModal(true);\r\n }, [errorKey]);\r\n\r\n const handleCancel = () => {\r\n dispatch(UIActions.clearError());\r\n setShowModal(false);\r\n };\r\n\r\n const translation = errorKey ? {t(`${errorKey}`)} : ;\r\n const message = additionalMessage ? (\r\n \r\n {additionalMessage.split('\\n').map((line, index) => (\r\n \r\n {line}\r\n
\r\n
\r\n ))}\r\n
\r\n ) : (\r\n \r\n );\r\n\r\n return (\r\n \r\n {t('okay')}\r\n ,\r\n ]}\r\n className=\"error-modal\"\r\n >\r\n {t('errors.errorOccurred')}\r\n {translation}\r\n {message}\r\n \r\n );\r\n};\r\n\r\nexport default ErrorDisplay;\r\n"],"names":["ErrorDisplay","t","useTranslation","dispatch","useDispatch","showModal","setShowModal","useState","errorKey","useSelector","state","ui","additionalMessage","errorMessage","useEffect","translation","_jsx","Paragraph","children","React","message","split","map","line","index","_jsxs","Modal","centered","visible","maskClosable","closable","footer","ZLButton","onClick","handleCancel","UIActions","clearError","Text","className","Heading","level","HeadingSize","One"],"sourceRoot":""}