grafana/public/app/plugins/panel/debug/DebugPanel.tsx
Josh Hunt 3c6e0e8ef8
Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00

31 lines
964 B
TypeScript

import React, { Component } from 'react';
import { PanelProps } from '@grafana/data';
import { CursorView } from './CursorView';
import { EventBusLoggerPanel } from './EventBusLogger';
import { RenderInfoViewer } from './RenderInfoViewer';
import { StateView } from './StateView';
import { DebugPanelOptions, DebugMode } from './types';
type Props = PanelProps<DebugPanelOptions>;
export class DebugPanel extends Component<Props> {
render() {
const { options } = this.props;
switch (options.mode) {
case DebugMode.Events:
return <EventBusLoggerPanel eventBus={this.props.eventBus} />;
case DebugMode.Cursor:
return <CursorView eventBus={this.props.eventBus} />;
case DebugMode.State:
return <StateView {...this.props} />;
case DebugMode.ThrowError:
throw new Error('I failed you and for that i am deeply sorry');
default:
return <RenderInfoViewer {...this.props} />;
}
}
}