"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Line = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
/*
 *  This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.
 *  License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
 */
const icon_1 = require("@cocalc/frontend/components/icon");
const theme_1 = require("@cocalc/util/theme");
const antd_1 = require("antd");
function PricingItem({ icon, children, title }) {
    return ((0, jsx_runtime_1.jsx)(antd_1.List.Item, { children: (0, jsx_runtime_1.jsx)(antd_1.Card, { headStyle: { backgroundColor: "#d9edf7" }, style: { color: theme_1.COLORS.GRAY }, type: "inner", title: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(icon_1.Icon, { name: icon, style: { marginRight: "10px" } }), " ", (0, jsx_runtime_1.jsx)("strong", { children: title })] }), children: children }) }));
}
exports.default = PricingItem;
const STYLE = {
    marginRight: "5px",
    display: "inline-block",
    color: theme_1.COLORS.GRAY_DD,
};
function Line(props) {
    const { amount, desc } = props;
    if (!amount)
        return ((0, jsx_runtime_1.jsxs)("div", { children: ["---", (0, jsx_runtime_1.jsx)("b", { style: STYLE, children: "\u00A0" })] }));
    let unit = "";
    if (desc?.includes("RAM") || desc?.includes("Disk")) {
        unit = "G";
    }
    else if (desc?.includes("CPU")) {
        unit = amount == 1 ? "core" : "cores";
    }
    else if (desc?.includes("Projects")) {
        unit = "simultaneous running";
    }
    return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("b", { style: STYLE, children: [amount, " ", unit] }), " ", desc] }));
}
exports.Line = Line;
//# sourceMappingURL=pricing-item.js.map