diff options
Diffstat (limited to 'subprojects/frontend/src/editor/GenerateButton.tsx')
-rw-r--r-- | subprojects/frontend/src/editor/GenerateButton.tsx | 13 |
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 @@ | |||
1 | import DangerousOutlinedIcon from '@mui/icons-material/DangerousOutlined'; | 1 | import DangerousOutlinedIcon from '@mui/icons-material/DangerousOutlined'; |
2 | import PlayArrowIcon from '@mui/icons-material/PlayArrow'; | 2 | import PlayArrowIcon from '@mui/icons-material/PlayArrow'; |
3 | import Button from '@mui/material/Button'; | 3 | import Button from '@mui/material/Button'; |
4 | import type { SxProps, Theme } from '@mui/material/styles'; | ||
4 | import { observer } from 'mobx-react-lite'; | 5 | import { observer } from 'mobx-react-lite'; |
5 | 6 | ||
6 | import AnimatedButton from './AnimatedButton'; | 7 | import AnimatedButton from './AnimatedButton'; |
@@ -11,13 +12,20 @@ const GENERATE_LABEL = 'Generate'; | |||
11 | const GenerateButton = observer(function GenerateButton({ | 12 | const 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… | 29 | Loading… |
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 | ||
61 | GenerateButton.defaultProps = { | 71 | GenerateButton.defaultProps = { |
62 | hideWarnings: false, | 72 | hideWarnings: false, |
73 | sx: undefined, | ||
63 | }; | 74 | }; |
64 | 75 | ||
65 | export default GenerateButton; | 76 | export default GenerateButton; |