mirror of
https://github.com/grafana/grafana.git
synced 2025-02-09 23:16:16 -06:00
Primarily- moving majority of the types and utils from @grafana/ui to @grafana/data * Move types from grafana-ui to grafana-data * Move valueFormats to grafana-data * Move utils from grafana-ui to grafana-data * Update imports in grafana-ui * revert data's tsconfig change * Update imports in grafana-runtime * Fix import paths in grafana-ui * Move rxjs to devDeps * Core import updates batch 1 * Import updates batch 2 * Imports fix batch 3 * Imports fixes batch i don't know * Fix imorts in grafana-toolkit * Fix imports after master merge
39 lines
875 B
TypeScript
39 lines
875 B
TypeScript
import React, { FC } from 'react';
|
|
import { AlphaNotice } from '@grafana/ui';
|
|
import { PluginState } from '@grafana/data';
|
|
import { css } from 'emotion';
|
|
|
|
interface Props {
|
|
state?: PluginState;
|
|
}
|
|
|
|
function getPluginStateInfoText(state?: PluginState): string | null {
|
|
switch (state) {
|
|
case PluginState.alpha:
|
|
return 'Alpha Plugin: This plugin is a work in progress and updates may include breaking changes';
|
|
case PluginState.beta:
|
|
return 'Beta Plugin: There could be bugs and minor breaking changes to this plugin';
|
|
}
|
|
return null;
|
|
}
|
|
|
|
const PluginStateinfo: FC<Props> = props => {
|
|
const text = getPluginStateInfoText(props.state);
|
|
|
|
if (!text) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<AlphaNotice
|
|
state={props.state}
|
|
text={text}
|
|
className={css`
|
|
margin-left: 16px;
|
|
`}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default PluginStateinfo;
|