summaryrefslogtreecommitdiffstats
path: root/components/Layout/index.tsx
blob: 4ed7762178a126146e99e4a804179acbbfdda934 (plain)
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
import React from 'react';
import classes from './layout.module.css';

type PropType = {
  style?: React.CSSProperties;
  left?: React.ReactChild | React.ReactChildren;
  right?: React.ReactChild | React.ReactChildren;
  children: React.ReactNode | React.ReactNodeArray;
};

export function Layout(props: PropType) {
  return (
    <div className={classes.wrapper} style={props.style}>
      <aside>{props.left}</aside>
      <main>{props.children}</main>
      <aside>{props.right}</aside>
    </div>
  );
}

Layout.defaultProps = {
  left: 'left column',
  right: 'right column',
  style: {},
};