CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/components/landing/main.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Breadcrumb, Layout } from "antd";
7
const { Content } = Layout;
8
9
interface Props {
10
children: React.ReactNode;
11
style?: React.CSSProperties;
12
nav?: JSX.Element[]; // list of links
13
}
14
15
const STYLE: React.CSSProperties = {
16
background: "white",
17
minHeight: "75vh",
18
maxWidth: "992px", // Antd screen-lg
19
width: "100%",
20
margin: "0 auto",
21
padding: "0 20px",
22
} as const;
23
24
export default function Main(props: Props) {
25
const { nav, children } = props;
26
27
const style = { ...STYLE, ...props.style };
28
29
function renderNav() {
30
if (nav == null) return null;
31
const items = nav.map((entry, idx) => ({
32
key: idx,
33
title: entry,
34
}));
35
return <Breadcrumb style={{ margin: "50px 0 25px 0" }} items={items} />;
36
}
37
38
return (
39
<Content style={style}>
40
{renderNav()}
41
{children}
42
</Content>
43
);
44
}
45
46