Files
www/components/layout.tsx
T
2023-10-30 00:18:38 -04:00

28 lines
596 B
TypeScript

import Title from './title';
type ChildrenType = JSX.Element | Array<ChildrenType>;
type LayoutProps = {
children?: ChildrenType,
removeContainer?: boolean,
};
function Container(props: {children?: ChildrenType, ignore?: boolean}) {
if (props.ignore)
return <>{props.children}</>;
return <div className='container'>
{props.children}
</div>;
}
function Layout(props : LayoutProps) {
return (
<>
<Title />
<Container ignore={props.removeContainer}>{props.children}</Container>
</>
);
}
export default Layout;