mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 19:26:31 -05:00
refactor: use application error alert in graphviz-frame
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
804a36bdf3
commit
6f0adfd717
1 changed files with 2 additions and 2 deletions
|
@ -9,8 +9,8 @@ import type { CodeProps } from '../../../components/markdown-renderer/replace-co
|
||||||
import { cypressId } from '../../../utils/cypress-attribute'
|
import { cypressId } from '../../../utils/cypress-attribute'
|
||||||
import { Logger } from '../../../utils/logger'
|
import { Logger } from '../../../utils/logger'
|
||||||
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
import { Alert } from 'react-bootstrap'
|
|
||||||
import { useAsync } from 'react-use'
|
import { useAsync } from 'react-use'
|
||||||
|
import { ApplicationErrorAlert } from '../../../components/common/application-error-alert/application-error-alert'
|
||||||
|
|
||||||
const log = new Logger('GraphvizFrame')
|
const log = new Logger('GraphvizFrame')
|
||||||
/**
|
/**
|
||||||
|
@ -60,7 +60,7 @@ export const GraphvizFrame: React.FC<CodeProps> = ({ code }) => {
|
||||||
return (
|
return (
|
||||||
<AsyncLoadingBoundary loading={isLibLoading || !graphvizImport} componentName={'graphviz'} error={libLoadingError}>
|
<AsyncLoadingBoundary loading={isLibLoading || !graphvizImport} componentName={'graphviz'} error={libLoadingError}>
|
||||||
<ShowIf condition={!!error}>
|
<ShowIf condition={!!error}>
|
||||||
<Alert variant={'warning'}>{error}</Alert>
|
<ApplicationErrorAlert className={'text-wrap'}>{error}</ApplicationErrorAlert>
|
||||||
</ShowIf>
|
</ShowIf>
|
||||||
<div className={'svg-container'} {...cypressId('graphviz')} ref={container} />
|
<div className={'svg-container'} {...cypressId('graphviz')} ref={container} />
|
||||||
</AsyncLoadingBoundary>
|
</AsyncLoadingBoundary>
|
||||||
|
|
Loading…
Reference in a new issue