aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/editor/GenerateButton.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/editor/GenerateButton.tsx')
-rw-r--r--subprojects/frontend/src/editor/GenerateButton.tsx17
1 files changed, 14 insertions, 3 deletions
diff --git a/subprojects/frontend/src/editor/GenerateButton.tsx b/subprojects/frontend/src/editor/GenerateButton.tsx
index 4b998af6..a28f6b4b 100644
--- a/subprojects/frontend/src/editor/GenerateButton.tsx
+++ b/subprojects/frontend/src/editor/GenerateButton.tsx
@@ -3,12 +3,23 @@ import Button from '@mui/material/Button';
3import { observer } from 'mobx-react-lite'; 3import { observer } from 'mobx-react-lite';
4import React from 'react'; 4import React from 'react';
5 5
6import { useRootStore } from '../RootStore'; 6import type EditorStore from './EditorStore';
7 7
8const GENERATE_LABEL = 'Generate'; 8const GENERATE_LABEL = 'Generate';
9 9
10function GenerateButton(): JSX.Element { 10function GenerateButton({
11 const { editorStore } = useRootStore(); 11 editorStore,
12}: {
13 editorStore: EditorStore | undefined;
14}): JSX.Element {
15 if (editorStore === undefined) {
16 return (
17 <Button color="inherit" className="rounded" disabled>
18 Loading&hellip;
19 </Button>
20 );
21 }
22
12 const { errorCount, warningCount } = editorStore; 23 const { errorCount, warningCount } = editorStore;
13 24
14 const diagnostics: string[] = []; 25 const diagnostics: string[] = [];