mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 16:45:43 -06:00
* Move InspectSubtitle to grafana/ui * Move inspect elements to features/inspector * Move InspectJSON and use it also in Explore * Move and use QueryInspector * Move all to features/inspector * WIP Data tab implementation * Process dataframes for explores inspector * Clean up * Update test * Clean up * Fix Explore Inspector button name
23 lines
489 B
TypeScript
23 lines
489 B
TypeScript
import React from 'react';
|
|
import { DataQueryError } from '@grafana/data';
|
|
import { JSONFormatter } from '@grafana/ui';
|
|
|
|
interface InspectErrorTabProps {
|
|
error?: DataQueryError;
|
|
}
|
|
|
|
export const InspectErrorTab: React.FC<InspectErrorTabProps> = ({ error }) => {
|
|
if (!error) {
|
|
return null;
|
|
}
|
|
if (error.data) {
|
|
return (
|
|
<>
|
|
<h3>{error.data.message}</h3>
|
|
<JSONFormatter json={error} open={2} />
|
|
</>
|
|
);
|
|
}
|
|
return <div>{error.message}</div>;
|
|
};
|