refactor: use application error alert in graphviz-frame

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-08-06 13:05:21 +02:00
parent 804a36bdf3
commit 6f0adfd717

View file

@ -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>