Version 3 of the kit: - Radix UI replaced with Base UI (using the Shadcn UI patterns) - next-intl replaces react-i18next - enhanceAction deprecated; usage moved to next-safe-action - main layout now wrapped with [locale] path segment - Teams only mode - Layout updates - Zod v4 - Next.js 16.2 - Typescript 6 - All other dependencies updated - Removed deprecated Edge CSRF - Dynamic Github Action runner
54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
import { use } from 'react';
|
|
|
|
import {
|
|
createKitEnvDeps,
|
|
createKitEnvService,
|
|
findWorkspaceRoot,
|
|
} from '@kit/mcp-server/env';
|
|
import { Page, PageBody, PageHeader } from '@kit/ui/page';
|
|
|
|
import { AppEnvironmentVariablesManager } from './components/app-environment-variables-manager';
|
|
|
|
import { EnvMode } from '@/app/variables/lib/types';
|
|
|
|
type VariablesPageProps = {
|
|
searchParams: Promise<{ mode?: EnvMode }>;
|
|
};
|
|
|
|
export const metadata = {
|
|
title: 'Environment Variables',
|
|
};
|
|
|
|
export default function VariablesPage({ searchParams }: VariablesPageProps) {
|
|
const { mode = 'development' } = use(searchParams);
|
|
const apps = use(loadEnvStates(mode));
|
|
|
|
return (
|
|
<Page style={'custom'}>
|
|
<div className={'flex h-screen flex-col overflow-hidden'}>
|
|
<PageHeader
|
|
displaySidebarTrigger={false}
|
|
title={'Environment Variables'}
|
|
description={
|
|
'Manage environment variables for your applications. Validate and set them up easily.'
|
|
}
|
|
/>
|
|
|
|
<PageBody className={'overflow-hidden'}>
|
|
<div className={'flex h-full flex-1 flex-col space-y-4'}>
|
|
{apps.map((app) => (
|
|
<AppEnvironmentVariablesManager key={app.appName} state={app} />
|
|
))}
|
|
</div>
|
|
</PageBody>
|
|
</div>
|
|
</Page>
|
|
);
|
|
}
|
|
|
|
async function loadEnvStates(mode: EnvMode) {
|
|
const rootPath = findWorkspaceRoot(process.cwd());
|
|
const service = createKitEnvService(createKitEnvDeps(rootPath));
|
|
return service.getAppState(mode);
|
|
}
|