2019-09-09 01:58:57 -05:00
|
|
|
import React, { FC } from 'react';
|
|
|
|
import { PluginState, AlphaNotice } from '@grafana/ui';
|
2019-05-07 05:18:08 -05:00
|
|
|
import { css } from 'emotion';
|
2019-04-12 06:46:42 -05:00
|
|
|
|
|
|
|
interface Props {
|
|
|
|
state?: PluginState;
|
|
|
|
}
|
|
|
|
|
2019-09-09 01:58:57 -05:00
|
|
|
function getPluginStateInfoText(state?: PluginState): JSX.Element | null {
|
2019-04-12 06:46:42 -05:00
|
|
|
switch (state) {
|
|
|
|
case PluginState.alpha:
|
2019-05-07 17:58:03 -05:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<h5>Alpha Plugin</h5>
|
|
|
|
<p>This plugin is a work in progress and updates may include breaking changes.</p>
|
|
|
|
</div>
|
|
|
|
);
|
2019-04-12 06:46:42 -05:00
|
|
|
|
|
|
|
case PluginState.beta:
|
2019-05-07 17:58:03 -05:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<h5>Beta Plugin</h5>
|
|
|
|
<p>There could be bugs and minor breaking changes to this plugin.</p>
|
|
|
|
</div>
|
|
|
|
);
|
2019-04-12 06:46:42 -05:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
const PluginStateinfo: FC<Props> = props => {
|
|
|
|
const text = getPluginStateInfoText(props.state);
|
2019-05-07 05:18:08 -05:00
|
|
|
|
|
|
|
return (
|
2019-09-09 01:58:57 -05:00
|
|
|
<AlphaNotice
|
|
|
|
state={props.state}
|
|
|
|
text={text}
|
|
|
|
className={css`
|
|
|
|
margin-left: 16px;
|
|
|
|
`}
|
|
|
|
/>
|
2019-05-07 05:18:08 -05:00
|
|
|
);
|
2019-04-12 06:46:42 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
export default PluginStateinfo;
|