Path: blob/master/src/packages/frontend/compute/cloud-filesystem/avatar.tsx
1503 views
import { Icon } from "@cocalc/frontend/components/icon";1import { human_readable_size } from "@cocalc/util/misc";2import { Button } from "antd";34export default function CloudFilesystemAvatar({5cloudFilesystem,6showMetrics,7setShowMetrics,8}) {9const { color, project_specific_id } = cloudFilesystem;10return (11<div style={{ width: "64px", marginBottom: "-20px" }}>12<Icon13name={"disk-round"}14style={{ fontSize: "30px", color: color ?? "#666" }}15/>16<div style={{ color: "#888" }}>Id: {project_specific_id}</div>17<div18style={{ color: "#888", cursor: "pointer" }}19onClick={() => {20setShowMetrics(!showMetrics);21}}22>23{human_readable_size(cloudFilesystem.bytes_used ?? 0)}24</div>25<Button26style={{ marginLeft: "-5px" }}27type={showMetrics ? "default" : "text"}28onClick={() => {29setShowMetrics(!showMetrics);30}}31>32<Icon style={{ fontSize: "15pt" }} name="graph" />33</Button>34</div>35);36}373839