2021-03-23 05:58:09 -05:00
|
|
|
import React from 'react';
|
|
|
|
import { useSelector } from 'react-redux';
|
|
|
|
import { ExploreId, StoreState } from '../../types';
|
|
|
|
import { LoadingState } from '@grafana/data';
|
|
|
|
import { ErrorContainer } from './ErrorContainer';
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
exploreId: ExploreId;
|
|
|
|
}
|
|
|
|
export function ResponseErrorContainer(props: Props) {
|
|
|
|
const queryResponse = useSelector((state: StoreState) => state.explore[props.exploreId]?.queryResponse);
|
|
|
|
|
2021-09-22 04:33:31 -05:00
|
|
|
const queryError = queryResponse?.state === LoadingState.Error ? queryResponse?.error : undefined;
|
2021-03-23 05:58:09 -05:00
|
|
|
|
|
|
|
return <ErrorContainer queryError={queryError} />;
|
|
|
|
}
|