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/frontend/compute/display-cloud.tsx
Views: 687
1
import type { Cloud as CloudType } from "@cocalc/util/db-schema/compute-servers";
2
import { CLOUDS_BY_NAME } from "@cocalc/util/compute/cloud/clouds";
3
import { Icon } from "@cocalc/frontend/components/icon";
4
5
interface Props {
6
cloud: CloudType;
7
height?: number | string;
8
style?;
9
}
10
11
export default function DisplayCloud({ cloud, height, style }: Props) {
12
const x = CLOUDS_BY_NAME[cloud];
13
let label;
14
if (x?.image) {
15
label = <img src={x.image} height={height ?? 18} alt={x.label} />;
16
} else {
17
label = x?.label ?? cloud ?? "No Cloud Configured";
18
}
19
return (
20
<span style={style}>
21
{x?.icon && <Icon name={x.icon} style={{ marginRight: "5px" }} />}
22
{label}
23
</span>
24
);
25
}
26
27