import React, { FunctionComponent } from 'react'; import { DataQueryError } from '@grafana/ui'; import { FadeIn } from 'app/core/components/Animations/FadeIn'; import { getFirstQueryErrorWithoutRefId, getValueWithRefId } from 'app/core/utils/explore'; interface Props { queryErrors: DataQueryError[]; } export const ErrorContainer: FunctionComponent = props => { const { queryErrors } = props; const refId = getValueWithRefId(queryErrors); const queryError = refId ? null : getFirstQueryErrorWithoutRefId(queryErrors); const showError = queryError ? true : false; const duration = showError ? 100 : 10; const message = queryError ? queryError.message : null; return (
{message}
); };