File size: 667 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { __experimentalVStack as VStack } from '@wordpress/components';
import './style.scss';

const sizes = {
	large: { maxWidth: '1344px' },
	small: { maxWidth: '660px' },
};

function PageLayout( {
	children,
	header,
	notices,
	size = 'large',
}: {
	children?: React.ReactNode;
	header?: React.ReactNode;
	notices?: React.ReactNode;
	size?: 'large' | 'small';
} ) {
	return (
		<VStack
			spacing={ 8 }
			className={ `dashboard-page-layout is-${ size }` }
			style={ sizes[ size ] }
		>
			{ header }
			{ notices }
			<VStack spacing={ 6 } className="dashboard-page-layout__content">
				{ children }
			</VStack>
		</VStack>
	);
}

export default PageLayout;