mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 16:45:43 -06:00
* Replace icons in dashboard and settings * Replace icons in alerting * Update batch of icons * Implement icons accross various files * Style updates * Search: Fix recent and starred icons * Update styling and details * Replace new icon created by unicons * Fix e2e test, styling * Minor styling updates Co-authored-by: Clarity-89 <homes89@ukr.net>
31 lines
943 B
TypeScript
31 lines
943 B
TypeScript
import React, { FunctionComponent } from 'react';
|
|
import { DataQueryError } from '@grafana/data';
|
|
import { Icon } from '@grafana/ui';
|
|
import { FadeIn } from 'app/core/components/Animations/FadeIn';
|
|
|
|
export interface ErrorContainerProps {
|
|
queryError?: DataQueryError;
|
|
}
|
|
|
|
export const ErrorContainer: FunctionComponent<ErrorContainerProps> = props => {
|
|
const { queryError } = props;
|
|
const showError = queryError ? true : false;
|
|
const duration = showError ? 100 : 10;
|
|
const message = queryError ? queryError.message : null;
|
|
|
|
return (
|
|
<FadeIn in={showError} duration={duration}>
|
|
<div className="alert-container">
|
|
<div className="alert-error alert">
|
|
<div className="alert-icon">
|
|
<Icon name="exclamation-triangle" />
|
|
</div>
|
|
<div className="alert-body">
|
|
<div className="alert-title">{message}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</FadeIn>
|
|
);
|
|
};
|