import {disablePlugin, enablePlugin} from 'sentry/actionCreators/plugins'; import InactivePlugins from 'sentry/components/inactivePlugins'; import PluginConfig from 'sentry/components/pluginConfig'; import {t} from 'sentry/locale'; import {Organization, Plugin, Project} from 'sentry/types'; import {Panel, PanelItem} from './panels'; type Props = { organization: Organization; pluginList: Plugin[]; project: Project; onDisablePlugin?: (plugin: Plugin) => void; onEnablePlugin?: (plugin: Plugin) => void; }; const PluginList = ({ organization, project, pluginList, onDisablePlugin = () => {}, onEnablePlugin = () => {}, }: Props) => { const handleEnablePlugin = (plugin: Plugin) => { enablePlugin({ projectId: project.slug, orgId: organization.slug, pluginId: plugin.slug, }); onEnablePlugin(plugin); }; const handleDisablePlugin = (plugin: Plugin) => { disablePlugin({ projectId: project.slug, orgId: organization.slug, pluginId: plugin.slug, }); onDisablePlugin(plugin); }; if (!pluginList.length) { return ( {t("Oops! Looks like there aren't any available integrations installed.")} ); } return (
{pluginList .filter(p => p.enabled) .map(data => ( ))} !p.enabled && !p.isHidden)} onEnablePlugin={handleEnablePlugin} />
); }; export default PluginList;