feat: add manual template editor with view/edit modes

This commit is contained in:
sokol
2026-02-18 17:09:32 +03:00
parent acce21c0e6
commit 15f890abda
3 changed files with 131 additions and 15 deletions

View File

@@ -90,6 +90,15 @@ function App() {
});
}
function handleTemplateSaved(newContent: string) {
setConfig(prevConfig => {
const newConfig = new Config();
newConfig.envs = prevConfig.envs;
newConfig.addTemplate(newContent);
return newConfig;
});
}
return (
<>
<main className="container-fluid m-2">
@@ -111,7 +120,7 @@ function App() {
onRemove={handleEnvRemoved} />
</section>
<section id="content" className="col-8 col-xl-7 border-start ms-1">
<Content env={currentEnv} config={config} />
<Content env={currentEnv} config={config} onTemplateSaved={handleTemplateSaved} />
</section>
</div>)
: