import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { PluginUtils } from '@baseplate-dev/project-builder-lib';
import { useProjectDefinition } from '@baseplate-dev/project-builder-lib/web';
import { NavigationTabs, NavigationTabsItem, } from '@baseplate-dev/ui-components';
import { Link } from '@tanstack/react-router';
export 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 (_jsxs(NavigationTabs, { children: [_jsx(NavigationTabsItem, { asChild: true, children: _jsx(Link, { to: "/plugins/edit/$key", params: { key: emailPlugin.metadata.key }, activeOptions: { exact: true }, children: "Email" }) }), _jsx(NavigationTabsItem, { asChild: true, children: _jsx(Link, { to: `/plugins/edit/${emailImplementationPlugin.metadata.key}`, activeOptions: { exact: true }, children: emailImplementationPlugin.metadata.displayName }) })] }));
}
//# sourceMappingURL=email-config-tabs.js.map