mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-18 21:15:16 +02:00
19 lines
646 B
TypeScript
19 lines
646 B
TypeScript
import { connection } from "next/server";
|
|
import { RuntimeConfigProvider } from "@/components/providers/runtime-config";
|
|
import {
|
|
BUILD_TIME_AUTH_TYPE,
|
|
BUILD_TIME_DEPLOYMENT_MODE,
|
|
BUILD_TIME_ETL_SERVICE,
|
|
} from "@/lib/env-config";
|
|
|
|
export async function RuntimeConfig({ children }: { children: React.ReactNode }) {
|
|
await connection();
|
|
|
|
const value = {
|
|
authType: process.env.AUTH_TYPE ?? BUILD_TIME_AUTH_TYPE,
|
|
etlService: process.env.ETL_SERVICE ?? BUILD_TIME_ETL_SERVICE,
|
|
deploymentMode: process.env.DEPLOYMENT_MODE ?? BUILD_TIME_DEPLOYMENT_MODE,
|
|
};
|
|
|
|
return <RuntimeConfigProvider value={value}>{children}</RuntimeConfigProvider>;
|
|
}
|