mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-24 02:47:53 -05:00
24 lines
655 B
TypeScript
24 lines
655 B
TypeScript
import { redirect } from "next/navigation";
|
|
import { IS_FORMBRICKS_CLOUD } from "@/lib/constants";
|
|
import { getBillingFallbackPath } from "@/lib/membership/navigation";
|
|
import { getWorkspaceAuth } from "@/modules/workspaces/lib/utils";
|
|
|
|
const ConfigLayout = async (props: {
|
|
params: Promise<{ workspaceId: string }>;
|
|
children: React.ReactNode;
|
|
}) => {
|
|
const params = await props.params;
|
|
|
|
const { children } = props;
|
|
|
|
const { isBilling } = await getWorkspaceAuth(params.workspaceId);
|
|
|
|
if (isBilling) {
|
|
return redirect(getBillingFallbackPath(params.workspaceId, IS_FORMBRICKS_CLOUD));
|
|
}
|
|
|
|
return children;
|
|
};
|
|
|
|
export default ConfigLayout;
|