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 AuthConfigTabs() {
    const { definition, schemaParserContext } = useProjectDefinition();
    const authPlugin = schemaParserContext.pluginStore.availablePlugins.find((p) => p.metadata.packageName === '@baseplate-dev/plugin-auth' &&
        p.metadata.name === 'auth');
    if (!authPlugin) {
        return null;
    }
    const authConfig = PluginUtils.configByKey(definition, authPlugin.metadata.key);
    const implementationPluginKey = authConfig?.implementationPluginKey;
    const authImplementationPlugin = schemaParserContext.pluginStore.availablePlugins.find((p) => p.metadata.key === implementationPluginKey);
    if (!authImplementationPlugin) {
        return null;
    }
    return (_jsxs(NavigationTabs, { children: [_jsx(NavigationTabsItem, { asChild: true, children: _jsx(Link, { to: "/plugins/edit/$key", params: { key: authPlugin.metadata.key }, activeOptions: { exact: true }, children: "Auth" }) }), _jsx(NavigationTabsItem, { asChild: true, children: _jsx(Link, { to: `/plugins/edit/${authImplementationPlugin.metadata.key}`, activeOptions: { exact: true }, children: authImplementationPlugin.metadata.displayName }) })] }));
}
//# sourceMappingURL=auth-config-tabs.js.map