mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 05:37:53 +08:00

* Plugins: Remove managedPluginsInstall feature toggle Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
31 lines
832 B
TypeScript
31 lines
832 B
TypeScript
import { ReactElement } from 'react';
|
|
|
|
import { PluginType } from '@grafana/data';
|
|
import { config } from '@grafana/runtime';
|
|
|
|
import { CatalogPlugin } from '../../types';
|
|
|
|
import { GetStartedWithApp } from './GetStartedWithApp';
|
|
import { GetStartedWithDataSource } from './GetStartedWithDataSource';
|
|
|
|
type Props = {
|
|
plugin: CatalogPlugin;
|
|
};
|
|
|
|
export function GetStartedWithPlugin({ plugin }: Props): ReactElement | null {
|
|
const isInstalled = config.pluginAdminExternalManageEnabled ? plugin.isFullyInstalled : plugin.isInstalled;
|
|
|
|
if (!isInstalled || plugin.isDisabled) {
|
|
return null;
|
|
}
|
|
|
|
switch (plugin.type) {
|
|
case PluginType.datasource:
|
|
return <GetStartedWithDataSource plugin={plugin} />;
|
|
case PluginType.app:
|
|
return <GetStartedWithApp plugin={plugin} />;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|