-
Notifications
You must be signed in to change notification settings - Fork 160
/
index.tsx
73 lines (72 loc) · 2.06 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { FC } from "react";
import { Photon } from "@lepton-dashboard/interfaces/photon";
import { useAntdTheme } from "@lepton-dashboard/hooks/use-antd-theme";
import { Col } from "antd";
import { css } from "@emotion/react";
import { Description } from "@lepton-dashboard/components/description";
import { CarbonIcon } from "@lepton-dashboard/components/icons";
import {
Column,
ContainerRegistry,
CopyLink,
Link as CarbonLink,
Parameter,
PortOutput,
WorkspaceImport,
} from "@carbon/icons-react";
import { Link } from "@lepton-dashboard/components/link";
export const ExtraInfo: FC<{ photon: Photon; versionView: boolean }> = ({
photon,
versionView,
}) => {
const theme = useAntdTheme();
return (
<Col
span={24}
css={css`
color: ${theme.colorTextDescription};
font-size: 12px;
`}
>
<Description.Item
icon={<CarbonIcon icon={<Column />} />}
term="ID"
description={
<Link to={`/photons/detail/${photon.id}`}>{photon.id}</Link>
}
/>
{versionView && (
<Description.Item
icon={<CarbonIcon icon={<CopyLink />} />}
term="Model"
description={photon.model}
/>
)}
<Description.Item
icon={<CarbonIcon icon={<Parameter />} />}
term="Arguments"
description={photon.container_args?.join(", ") || "-"}
/>
<Description.Item
icon={<CarbonIcon icon={<ContainerRegistry />} />}
term="Requirements"
description={photon.requirement_dependency?.join(", ") || "-"}
/>
<Description.Item
icon={<CarbonIcon icon={<WorkspaceImport />} />}
term="Entrypoint"
description={photon.entrypoint || "-"}
/>
<Description.Item
term="Exposed Ports"
icon={<CarbonIcon icon={<PortOutput />} />}
description={photon.exposed_ports?.join(", ") || "-"}
/>
<Description.Item
term="Image URL"
icon={<CarbonIcon icon={<CarbonLink />} />}
description={photon.image || "-"}
/>
</Col>
);
};