8000 feat: update template embed page for dynamic params · coder/coder@9548678 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9548678

Browse files
committed
feat: update template embed page for dynamic params
1 parent 18a81ae commit 9548678

File tree

4 files changed

+443
-3
lines changed

4 files changed

+443
-3
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { useDashboard } from "modules/dashboard/useDashboard";
2+
import { type FC, createContext } from "react";
3+
import TemplateEmbedPage from "./TemplateEmbedPage";
4+
import TemplateEmbedPageExperimental from "./TemplateEmbedPageExperimental";
5+
6+
// Similar context as in CreateWorkspaceExperimentRouter for maintaining consistency
7+
export const ExperimentalFormContext = createContext<
8+
{ toggleOptedOut: () => void } | undefined
9+
>(undefined);
10+
11+
const TemplateEmbedExperimentRouter: FC = () => {
12+
const { experiments } = useDashboard();
13+
const dynamicParametersEnabled = experiments.includes("dynamic-parameters");
14+
15+
if (dynamicParametersEnabled) {
16+
return <TemplateEmbedPageExperimental />;
17+
}
18+
19+
return <TemplateEmbedPage />;
20+
};
21+
22+
export default TemplateEmbedExperimentRouter;

0 commit comments

Comments
 (0)
0