1- import { CSSProperties , ReactElement } from "react" ;
1+ import { CSSProperties , ReactElement } from "react" ;
22
3- import { Contribution } from "../model/contribution" ;
43import { PropertyChangeHandler } from "../model/component" ;
54import DashiComponent from "../components/DashiComponent" ;
65import { ContributionState } from "../store/appStore" ;
7- import { CircularProgress } from "@mui/material" ;
6+ import { CircularProgress } from "@mui/material" ;
7+ import { PanelModel } from "../model/panel" ;
88
99const panelContainerStyle : CSSProperties = {
1010 display : "flex" ,
@@ -15,8 +15,15 @@ const panelContainerStyle: CSSProperties = {
1515 border : "1px gray solid" ,
1616} ;
1717
18+ const panelHeaderStyle : CSSProperties = {
19+ display : "flex" ,
20+ flexDirection : "column" ,
21+ width : "100%" ,
22+ textAlign : "center" ,
23+ } ;
24+
1825interface PanelProps {
19- panelModel : Contribution ;
26+ panelModel : PanelModel ;
2027 panelState : ContributionState ;
2128 onPropertyChange : PropertyChangeHandler ;
2229}
@@ -41,9 +48,19 @@ function Panel({ panelModel, panelState, onPropertyChange }: PanelProps) {
4148 </ span >
4249 ) ;
4350 } else if ( componentModelResult . status === "pending" ) {
44- panelElement = < span > < CircularProgress size = { 30 } color = "secondary" /> Loading { panelModel . name } ...</ span > ;
51+ panelElement = (
52+ < span >
53+ < CircularProgress size = { 30 } color = "secondary" /> Loading{ " " }
54+ { panelModel . name } ...
55+ </ span >
56+ ) ;
4557 }
46- return < div style = { panelContainerStyle } > { panelElement } </ div > ;
58+ return (
59+ < div style = { panelContainerStyle } >
60+ < div style = { panelHeaderStyle } > { panelModel . title } </ div >
61+ { panelElement }
62+ </ div >
63+ ) ;
4764}
4865
4966export default Panel ;
0 commit comments