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.tsx13
1 files changed, 12 insertions, 1 deletions
diff --git a/subprojects/frontend/src/editor/GenerateButton.tsx b/subprojects/frontend/src/editor/GenerateButton.tsx
index 1a32f5ce..2036fc28 100644
--- a/subprojects/frontend/src/editor/GenerateButton.tsx
+++ b/subprojects/frontend/src/editor/GenerateButton.tsx
@@ -1,6 +1,7 @@
1import DangerousOutlinedIcon from '@mui/icons-material/DangerousOutlined'; 1import DangerousOutlinedIcon from '@mui/icons-material/DangerousOutlined';
2import PlayArrowIcon from '@mui/icons-material/PlayArrow'; 2import PlayArrowIcon from '@mui/icons-material/PlayArrow';
3import Button from '@mui/material/Button'; 3import Button from '@mui/material/Button';
4import type { SxProps, Theme } from '@mui/material/styles';
4import { observer } from 'mobx-react-lite'; 5import { observer } from 'mobx-react-lite';
5 6
6import AnimatedButton from './AnimatedButton'; 7import AnimatedButton from './AnimatedButton';
@@ -11,13 +12,20 @@ const GENERATE_LABEL = 'Generate';
11const GenerateButton = observer(function GenerateButton({ 12const GenerateButton = observer(function GenerateButton({
12 editorStore, 13 editorStore,
13 hideWarnings, 14 hideWarnings,
15 sx,
14}: { 16}: {
15 editorStore: EditorStore | undefined; 17 editorStore: EditorStore | undefined;
16 hideWarnings?: boolean | undefined; 18 hideWarnings?: boolean | undefined;
19 sx?: SxProps<Theme> | undefined;
17}): JSX.Element { 20}): JSX.Element {
18 if (editorStore === undefined) { 21 if (editorStore === undefined) {
19 return ( 22 return (
20 <Button color="inherit" variant="outlined" className="rounded" disabled> 23 <Button
24 color="inherit"
25 className="rounded shaded"
26 disabled
27 {...(sx === undefined ? {} : { sx })}
28 >
21 Loading&hellip; 29 Loading&hellip;
22 </Button> 30 </Button>
23 ); 31 );
@@ -41,6 +49,7 @@ const GenerateButton = observer(function GenerateButton({
41 onClick={() => editorStore.nextDiagnostic()} 49 onClick={() => editorStore.nextDiagnostic()}
42 color="error" 50 color="error"
43 startIcon={<DangerousOutlinedIcon />} 51 startIcon={<DangerousOutlinedIcon />}
52 {...(sx === undefined ? {} : { sx })}
44 > 53 >
45 {summary} 54 {summary}
46 </AnimatedButton> 55 </AnimatedButton>
@@ -52,6 +61,7 @@ const GenerateButton = observer(function GenerateButton({
52 disabled={!editorStore.opened} 61 disabled={!editorStore.opened}
53 color={warningCount > 0 ? 'warning' : 'primary'} 62 color={warningCount > 0 ? 'warning' : 'primary'}
54 startIcon={<PlayArrowIcon />} 63 startIcon={<PlayArrowIcon />}
64 {...(sx === undefined ? {} : { sx })}
55 > 65 >
56 {summary === '' ? GENERATE_LABEL : `${GENERATE_LABEL} (${summary})`} 66 {summary === '' ? GENERATE_LABEL : `${GENERATE_LABEL} (${summary})`}
57 </AnimatedButton> 67 </AnimatedButton>
@@ -60,6 +70,7 @@ const GenerateButton = observer(function GenerateButton({
60 70
61GenerateButton.defaultProps = { 71GenerateButton.defaultProps = {
62 hideWarnings: false, 72 hideWarnings: false,
73 sx: undefined,
63}; 74};
64 75
65export default GenerateButton; 76export default GenerateButton;