Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/next/lib/landing/render-envs.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Typography } from "antd";6import React from "react";78import A from "components/misc/A";9import { ExecInfo, SoftwareSpecEntry } from "./types";10import SanitizedMarkdown from "components/misc/sanitized-markdown";1112const { Paragraph } = Typography;1314export const VERSION_STYLE: React.CSSProperties = {15maxHeight: "8em",16whiteSpace: "pre-wrap",17backgroundColor: "rgba(150, 150, 150, 0.1)",18fontSize: "12px",19padding: "10px",20overflow: "auto",21marginBottom: "20px",22} as const;2324interface Props {25spec: Record<string, SoftwareSpecEntry>;26execInfo?: ExecInfo;27}2829export function ExecutableDescription(props: Props) {30const { spec, execInfo } = props;31function renderEnvs() {32const envs: JSX.Element[] = [];33for (const [key, info] of Object.entries(spec)) {34const version = execInfo?.[info.path];35envs.push(36<Paragraph key={key}>37<dt>38<A style={{ fontWeight: "bold" }} href={info.url}>39{info.name}40</A>41:42</dt>43<dd style={{ marginBottom: "0.5rem" }}>44<SanitizedMarkdown value={info.doc} />45{version && <div style={VERSION_STYLE}>{version}</div>}46</dd>47</Paragraph>48);49}50return envs;51}5253return <dl>{renderEnvs()}</dl>;54}555657