PluginStateInfo.tsx 958 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import React, { FC } from 'react';
  2. import { PluginState, AlphaNotice } from '@grafana/ui';
  3. import { css } from 'emotion';
  4. interface Props {
  5. state?: PluginState;
  6. }
  7. function getPluginStateInfoText(state?: PluginState): JSX.Element | null {
  8. switch (state) {
  9. case PluginState.alpha:
  10. return (
  11. <div>
  12. <h5>Alpha Plugin</h5>
  13. <p>This plugin is a work in progress and updates may include breaking changes.</p>
  14. </div>
  15. );
  16. case PluginState.beta:
  17. return (
  18. <div>
  19. <h5>Beta Plugin</h5>
  20. <p>There could be bugs and minor breaking changes to this plugin.</p>
  21. </div>
  22. );
  23. }
  24. return null;
  25. }
  26. const PluginStateinfo: FC<Props> = props => {
  27. const text = getPluginStateInfoText(props.state);
  28. return (
  29. <AlphaNotice
  30. state={props.state}
  31. text={text}
  32. className={css`
  33. margin-left: 16px;
  34. `}
  35. />
  36. );
  37. };
  38. export default PluginStateinfo;