From a2a4696fdbd6440269d576aeba7b25b2ea40d9bf Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Tue, 12 Sep 2023 21:59:50 +0200 Subject: feat: connect model generator to UI --- subprojects/frontend/src/editor/GenerateButton.tsx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'subprojects/frontend/src/editor/GenerateButton.tsx') diff --git a/subprojects/frontend/src/editor/GenerateButton.tsx b/subprojects/frontend/src/editor/GenerateButton.tsx index 5bac0464..b8dcd531 100644 --- a/subprojects/frontend/src/editor/GenerateButton.tsx +++ b/subprojects/frontend/src/editor/GenerateButton.tsx @@ -5,6 +5,7 @@ */ import CancelIcon from '@mui/icons-material/Cancel'; +import CloseIcon from '@mui/icons-material/Close'; import PlayArrowIcon from '@mui/icons-material/PlayArrow'; import { observer } from 'mobx-react-lite'; @@ -28,8 +29,10 @@ const GenerateButton = observer(function GenerateButton({ ); } - const { analyzing, errorCount, warningCount, semanticsError } = - editorStore.delayedErrors; + const { + delayedErrors: { analyzing, errorCount, warningCount, semanticsError }, + generating, + } = editorStore; if (analyzing) { return ( @@ -39,6 +42,18 @@ const GenerateButton = observer(function GenerateButton({ ); } + if (generating) { + return ( + editorStore.cancelModelGeneration()} + startIcon={} + > + Cancel + + ); + } + if (semanticsError !== undefined && editorStore.opened) { return ( 0 ? 'warning' : 'primary'} startIcon={} + onClick={() => editorStore.startModelGeneration()} > {summary === '' ? GENERATE_LABEL : `${GENERATE_LABEL} (${summary})`} -- cgit v1.2.3-70-g09d2