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/images.tsx
Views: 687
1
import { Spin } from "antd";
2
import { Icon } from "@cocalc/frontend/components/icon";
3
4
export function RenderImage({
5
configuration,
6
style,
7
IMAGES,
8
}: {
9
configuration: { image: string };
10
style?;
11
IMAGES;
12
}) {
13
if (IMAGES == null) {
14
return <Spin />;
15
}
16
const { image } = configuration ?? {};
17
if (image == null) return null;
18
const data = IMAGES[image];
19
if (data == null) {
20
return <span style={style}>{image}</span>;
21
}
22
return (
23
<span style={style}>
24
<Icon name={data.icon} style={{ marginRight: "5px" }} /> {data.label}
25
</span>
26
);
27
}
28
29