{instances.map((instance, i) => (
state.templateLanguage);
+ const setLanguage = usePlaygroundContext(
+ (state) => state.setTemplateLanguage
+ );
+ return (
+ {
+ if (isTemplateLanguage(v)) {
+ setLanguage(v);
+ }
+ }}
+ >
+
+ Mustache
+
+
+ F-String
+
+
+ );
+}
diff --git a/app/src/store/playground/playgroundStore.tsx b/app/src/store/playground/playgroundStore.tsx
index 11f6e21502..b0d41009f6 100644
--- a/app/src/store/playground/playgroundStore.tsx
+++ b/app/src/store/playground/playgroundStore.tsx
@@ -251,6 +251,8 @@ export const createPlaygroundStore = (
},
setTemplateLanguage: (templateLanguage: TemplateLanguage) => {
set({ templateLanguage });
+ // Re-compute variables when the template language changes
+ get().calculateVariables();
},
calculateVariables: () => {
const instances = get().instances;