grafana/public/app/plugins/datasource/loki/components/LokiQueryEditorByApp.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

33 lines
1.1 KiB
TypeScript

import React, { memo } from 'react';
import { CoreApp } from '@grafana/data';
import { config } from '@grafana/runtime';
import { LokiQueryEditorSelector } from '../querybuilder/components/LokiQueryEditorSelector';
import { LokiExploreQueryEditor } from './LokiExploreQueryEditor';
import { LokiQueryEditor } from './LokiQueryEditor';
import { LokiQueryEditorForAlerting } from './LokiQueryEditorForAlerting';
import { LokiQueryEditorProps } from './types';
export function LokiQueryEditorByApp(props: LokiQueryEditorProps) {
const { app } = props;
switch (app) {
case CoreApp.CloudAlerting:
return <LokiQueryEditorForAlerting {...props} />;
case CoreApp.Explore:
if (config.featureToggles.lokiQueryBuilder) {
return <LokiQueryEditorSelector {...props} />;
}
return <LokiExploreQueryEditor {...props} />;
default:
if (config.featureToggles.lokiQueryBuilder) {
return <LokiQueryEditorSelector {...props} />;
}
return <LokiQueryEditor {...props} />;
}
}
export default memo(LokiQueryEditorByApp);