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 from "react";
import Icon from "../asorted/Icon";
import FlexBox from "../layout/Flex";
import Text from "../asorted/Text";
/**
 * A column which contains a single icon and that has a fixed width.
 */
function iconColumn({ props, header, layout, }) {
    return {
        layout: layout || "min-content",
        render: ({ elt }) => {
            const _a = props(elt), { name, weight } = _a, textProps = __rest(_a, ["name", "weight"]);
            return (React.createElement(Text, Object.assign({}, textProps, { style: { display: "flex", alignItems: "center" } }),
                React.createElement(Icon, { name: name, weight: weight })));
        },
        header,
    };
}
export { iconColumn as icon };
/**
 * A column that contains a title and a subtitle.
 */
function textColumn({ title, subtitle, header, layout, titleProps, subtitleProps, }) {
    return {
        layout: layout || "auto",
        render: ({ elt }) => (React.createElement(FlexBox, { flexDirection: "column", justifyContent: "center" },
            title && (React.createElement(Text, Object.assign({ fontWeight: "medium", variant: "body", textOverflow: "ellipsis", overflow: "hidden", color: "neutral.c100" }, ((titleProps && titleProps(elt)) || {})), title(elt))),
            subtitle && (React.createElement(Text, Object.assign({ fontWeight: "medium", variant: "paragraph", textOverflow: "ellipsis", overflow: "hidden", color: "neutral.c80" }, ((subtitleProps && subtitleProps(elt)) || {})), subtitle(elt))))),
        header,
    };
}
export { textColumn as text };
//# sourceMappingURL=Columns.js.map