Path: blob/master/src/packages/next/components/landing/main.tsx
1450 views
/*1* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Breadcrumb, Layout } from "antd";6import type { JSX } from "react";7const { Content } = Layout;89interface Props {10children: React.ReactNode;11style?: React.CSSProperties;12nav?: JSX.Element[]; // list of links13}1415const STYLE: React.CSSProperties = {16background: "white",17minHeight: "75vh",18maxWidth: "992px", // Antd screen-lg19width: "100%",20margin: "0 auto",21padding: "0 20px",22} as const;2324export default function Main(props: Props) {25const { nav, children } = props;2627const style = { ...STYLE, ...props.style };2829function renderNav() {30if (nav == null) return null;31const items = nav.map((entry, idx) => ({32key: idx,33title: entry,34}));35return <Breadcrumb style={{ margin: "50px 0 25px 0" }} items={items} />;36}3738return (39<Content style={style}>40{renderNav()}41{children}42</Content>43);44}454647