@@ -39,28 +39,38 @@ const StyledBox = styled(Box)(({theme}) => ({
3939 } ,
4040} ) ) ;
4141
42- export default function SectionContainer ( { title, titleExtras, children, style} ) {
42+ export default function SectionContainer ( { title, titleExtras, children, style, resizable = false , defaultHeight = 200 } ) {
43+ const content = (
44+ < >
45+ < Box className = 'SectionContainer-cardHeader' title = { title } >
46+ < div className = 'SectionContainer-cardTitle' > { title } </ div >
47+ < div style = { { marginLeft : 'auto' } } >
48+ { titleExtras }
49+ </ div >
50+ </ Box >
51+ < Box height = "100%" display = "flex" flexDirection = "column" minHeight = { 0 } >
52+ { children }
53+ </ Box >
54+ </ >
55+ ) ;
56+
4357 return (
4458 < StyledBox className = 'SectionContainer-root' style = { style } >
45- < Resizable
46- enable = { { bottom : true } }
47- defaultSize = { { height : 200 , width : '100%' } }
48- minHeight = { 25 }
49- style = { {
50- display : 'flex' ,
51- flexDirection : 'column'
52- } }
53- >
54- < Box className = 'SectionContainer-cardHeader' title = { title } >
55- < div className = 'SectionContainer-cardTitle' > { title } </ div >
56- < div style = { { marginLeft : 'auto' } } >
57- { titleExtras }
58- </ div >
59- </ Box >
60- < Box height = "100%" display = "flex" flexDirection = "column" minHeight = { 0 } >
61- { children }
62- </ Box >
63- </ Resizable >
59+ { resizable ? (
60+ < Resizable
61+ enable = { { bottom : true } }
62+ defaultSize = { { height : defaultHeight , width : '100%' } }
63+ minHeight = { 25 }
64+ style = { {
65+ display : 'flex' ,
66+ flexDirection : 'column'
67+ } }
68+ >
69+ { content }
70+ </ Resizable >
71+ ) : (
72+ content
73+ ) }
6474 </ StyledBox >
6575 ) ;
6676}
@@ -70,4 +80,6 @@ SectionContainer.propTypes = {
7080 titleExtras : PropTypes . node ,
7181 children : PropTypes . node . isRequired ,
7282 style : PropTypes . object ,
83+ resizable : PropTypes . bool ,
84+ defaultHeight : PropTypes . number ,
7385} ;
0 commit comments