import React from "react";
import Pill from "../Pill/Pill";
import { Black } from "../../../Types/BrandColors";
import Color from "../../../Types/Color";
import IconProp from "../../../Types/Icon/IconProp";
const LabelElement = (props) => {
    const { label } = props;
    const resolveColor = (() => {
        if (!label.color) {
            return Black;
        }
        if (typeof label.color === "string") {
            return Color.fromString(label.color);
        }
        return label.color;
    })();
    const text = label.name || label.slug || "";
    const pillProps = {
        color: resolveColor,
        text,
        size: props.size,
        isMinimal: props.isMinimal,
        tooltip: label.description || undefined,
        icon: IconProp.EmptyCircle,
    };
    if (props.style) {
        pillProps.style = props.style;
    }
    return React.createElement(Pill, Object.assign({}, pillProps));
};
export default LabelElement;
//# sourceMappingURL=Label.js.map