import { importShared } from './__federation_fn_import-DDy87RIy.js';
import { j as jsxRuntimeExports } from './jsx-runtime-XI9uIe3W.js';

const {PluginUtils} = await importShared('@baseplate-dev/project-builder-lib');

const {useProjectDefinition} = await importShared('@baseplate-dev/project-builder-lib/web');

const {NavigationTabs,NavigationTabsItem} = await importShared('@baseplate-dev/ui-components');

const {Link} = await importShared('@tanstack/react-router');

function EmailConfigTabs() {
  const { definition, schemaParserContext } = useProjectDefinition();
  const emailPlugin = schemaParserContext.pluginStore.availablePlugins.find(
    (p) => p.metadata.packageName === "@baseplate-dev/plugin-email" && p.metadata.name === "email"
  );
  if (!emailPlugin) {
    return null;
  }
  const emailConfig = PluginUtils.configByKey(
    definition,
    emailPlugin.metadata.key
  );
  const implementationPluginKey = emailConfig?.implementationPluginKey;
  const emailImplementationPlugin = schemaParserContext.pluginStore.availablePlugins.find(
    (p) => p.metadata.key === implementationPluginKey
  );
  if (!emailImplementationPlugin) {
    return null;
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(NavigationTabs, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(NavigationTabsItem, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      Link,
      {
        to: "/plugins/edit/$key",
        params: { key: emailPlugin.metadata.key },
        activeOptions: { exact: true },
        children: "Email"
      }
    ) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(NavigationTabsItem, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      Link,
      {
        to: `/plugins/edit/${emailImplementationPlugin.metadata.key}`,
        activeOptions: { exact: true },
        children: emailImplementationPlugin.metadata.displayName
      }
    ) })
  ] });
}

export { EmailConfigTabs as E };
//# sourceMappingURL=email-config-tabs-D4ah5Oeo.js.map
