mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 07:34:42 -04:00
refactor: use application error alert in abc-frame
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
cb38d5dedf
commit
cdd368bc81
1 changed files with 2 additions and 5 deletions
|
@ -12,9 +12,8 @@ import { cypressId } from '../../../utils/cypress-attribute'
|
||||||
import { Logger } from '../../../utils/logger'
|
import { Logger } from '../../../utils/logger'
|
||||||
import styles from './abc.module.scss'
|
import styles from './abc.module.scss'
|
||||||
import React, { useRef } from 'react'
|
import React, { useRef } from 'react'
|
||||||
import { Alert } from 'react-bootstrap'
|
|
||||||
import { Trans } from 'react-i18next'
|
|
||||||
import { useAsync } from 'react-use'
|
import { useAsync } from 'react-use'
|
||||||
|
import { TranslatedApplicationErrorAlert } from '../../../components/common/application-error-alert/translated-application-error-alert'
|
||||||
|
|
||||||
const log = new Logger('AbcFrame')
|
const log = new Logger('AbcFrame')
|
||||||
|
|
||||||
|
@ -51,9 +50,7 @@ export const AbcFrame: React.FC<CodeProps> = ({ code }) => {
|
||||||
return (
|
return (
|
||||||
<AsyncLoadingBoundary loading={loading || !abcLib} error={!!loadingError} componentName={'abc.js'}>
|
<AsyncLoadingBoundary loading={loading || !abcLib} error={!!loadingError} componentName={'abc.js'}>
|
||||||
<ShowIf condition={!!renderError}>
|
<ShowIf condition={!!renderError}>
|
||||||
<Alert variant={'danger'}>
|
<TranslatedApplicationErrorAlert errorI18nKey={'editor.embeddings.abcJs.errorWhileRendering'} />
|
||||||
<Trans i18nKey={'editor.embeddings.abcJs.errorWhileRendering'} />
|
|
||||||
</Alert>
|
|
||||||
</ShowIf>
|
</ShowIf>
|
||||||
<div
|
<div
|
||||||
ref={container}
|
ref={container}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue