1
- import { ExpansionPanel , ExpansionPanelDetails , ExpansionPanelSummary } from '@material-ui/core' ;
1
+ import { ExpansionPanel , ExpansionPanelDetails , ExpansionPanelSummary , CircularProgress } from '@material-ui/core' ;
2
2
import ExpandMoreIcon from '@material-ui/icons/ExpandMore' ;
3
3
import React , { memo , useCallback , useState } from 'react' ;
4
4
import { User } from '../../../bitbucket/model' ;
@@ -9,10 +9,11 @@ type SummaryPanelProps = {
9
9
htmlSummary : string ;
10
10
fetchUsers : ( input : string ) => Promise < User [ ] > ;
11
11
summaryChange : ( text : string ) => void ;
12
+ isLoading : boolean ;
12
13
} ;
13
14
14
15
export const SummaryPanel : React . FunctionComponent < SummaryPanelProps > = memo (
15
- ( { rawSummary, htmlSummary, fetchUsers, summaryChange } ) => {
16
+ ( { rawSummary, htmlSummary, fetchUsers, summaryChange, isLoading } ) => {
16
17
const [ internalExpanded , setInternalExpanded ] = useState ( true ) ;
17
18
18
19
const expansionHandler = useCallback ( ( event : React . ChangeEvent < { } > , expanded : boolean ) => {
@@ -39,12 +40,16 @@ export const SummaryPanel: React.FunctionComponent<SummaryPanelProps> = memo(
39
40
< PanelTitle > Summary</ PanelTitle >
40
41
</ ExpansionPanelSummary >
41
42
< ExpansionPanelDetails >
42
- < InlineRenderedTextEditor
43
- rawContent = { rawSummary }
44
- htmlContent = { htmlSummary }
45
- onSave = { handleSummaryChange }
46
- fetchUsers = { handleFetchUsers }
47
- />
43
+ { isLoading ? (
44
+ < CircularProgress />
45
+ ) : (
46
+ < InlineRenderedTextEditor
47
+ rawContent = { rawSummary }
48
+ htmlContent = { htmlSummary }
49
+ onSave = { handleSummaryChange }
50
+ fetchUsers = { handleFetchUsers }
51
+ />
52
+ ) }
48
53
</ ExpansionPanelDetails >
49
54
</ ExpansionPanel >
50
55
) ;
0 commit comments