FIX: Refactor both dialogs to get common code

This commit is contained in:
Nicolás Hatcher
2025-10-12 14:07:53 +02:00
committed by Nicolás Hatcher Andrés
parent dd29287c5a
commit ed64716f0f
4 changed files with 162 additions and 202 deletions

View File

@@ -161,15 +161,13 @@ function App() {
>
<TemplatesDialog
onClose={() => setTemplatesDialogOpen(false)}
onSelectTemplate={
async (fileName) => {
const model_bytes = await get_documentation_model(fileName);
const importedModel = Model.from_bytes(model_bytes);
saveModelToStorage(importedModel);
setModel(importedModel);
setTemplatesDialogOpen(false);
}
}
onSelectTemplate={async (fileName) => {
const model_bytes = await get_documentation_model(fileName);
const importedModel = Model.from_bytes(model_bytes);
saveModelToStorage(importedModel);
setModel(importedModel);
setTemplatesDialogOpen(false);
}}
/>
</Modal>
</Wrapper>