GetStartedWithPlugin.tsx 692 B

123456789101112131415161718192021222324252627
  1. import React, { ReactElement } from 'react';
  2. import { PluginType } from '@grafana/data';
  3. import { CatalogPlugin } from '../../types';
  4. import { GetStartedWithApp } from './GetStartedWithApp';
  5. import { GetStartedWithDataSource } from './GetStartedWithDataSource';
  6. type Props = {
  7. plugin: CatalogPlugin;
  8. };
  9. export function GetStartedWithPlugin({ plugin }: Props): ReactElement | null {
  10. if (!plugin.isInstalled || plugin.isDisabled) {
  11. return null;
  12. }
  13. switch (plugin.type) {
  14. case PluginType.datasource:
  15. return <GetStartedWithDataSource plugin={plugin} />;
  16. case PluginType.app:
  17. return <GetStartedWithApp plugin={plugin} />;
  18. default:
  19. return null;
  20. }
  21. }