var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React, { useMemo } from "react";
import * as styles from "./styles";
export const DemographicsTextCard = ({ options: { title, values }, }) => {
    const config = useMemo(() => {
        const isSingleItem = Boolean((values === null || values === void 0 ? void 0 : values.length) === 1);
        return {
            isSingleItem,
        };
    }, [values]);
    return (React.createElement("div", { className: styles.container },
        React.createElement("p", { className: styles.title }, title),
        React.createElement("div", { className: styles.values }, values === null || values === void 0 ? void 0 : values.map((_a) => {
            var { icon: Icon } = _a, item = __rest(_a, ["icon"]);
            return (React.createElement("div", { key: item.variable, className: styles.item, "data-is-single": config.isSingleItem },
                React.createElement("div", { className: styles.valueLabel },
                    config.isSingleItem && typeof Icon !== "undefined" && (React.createElement(Icon, { className: styles.icon, width: config.isSingleItem ? 32 : 16, height: config.isSingleItem ? 32 : 16 })),
                    !config.isSingleItem && (React.createElement("p", { className: styles.multipleItemLabel }, item.label))),
                config.isSingleItem ? (React.createElement("h2", { className: styles.singleItemText }, item.value)) : (React.createElement("p", { className: styles.multipleItemText }, item.value))));
        }))));
};
//# sourceMappingURL=index.js.map