mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-06 10:46:38 +00:00
toggle clients with feature flag
This commit is contained in:
21
src/app/[orgId]/settings/clients/layout.tsx
Normal file
21
src/app/[orgId]/settings/clients/layout.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { pullEnv } from "@app/lib/pullEnv";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
interface SettingsLayoutProps {
|
||||
children: React.ReactNode;
|
||||
params: Promise<{ orgId: string }>;
|
||||
}
|
||||
|
||||
export default async function SettingsLayout(props: SettingsLayoutProps) {
|
||||
const params = await props.params;
|
||||
const { children } = props;
|
||||
const env = pullEnv();
|
||||
|
||||
if (!env.flags.enableClients) {
|
||||
redirect(`/${params.orgId}/settings`);
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
Reference in New Issue
Block a user