import Icon, { SizeProp } from "../Icon/Icon";
import React from "react";
const IconText = ({ text, icon, iconColor = null, textColor = null, iconSize = SizeProp.Regular, iconClassName = "h-5 w-5", textClassName = "text-sm text-gray-900", containerClassName = "", spacing = "sm", alignment = "left", onClick, "data-testid": dataTestId, }) => {
    const getSpacingClass = () => {
        switch (spacing) {
            case "sm":
                return "gap-1";
            case "md":
                return "gap-2";
            case "lg":
                return "gap-3";
            default:
                return "gap-1";
        }
    };
    const getAlignmentClass = () => {
        switch (alignment) {
            case "center":
                return "justify-center";
            case "right":
                return "justify-end";
            case "left":
            default:
                return "justify-start";
        }
    };
    const handleClick = () => {
        if (onClick) {
            onClick();
        }
    };
    return (React.createElement("div", { className: `flex items-center ${getSpacingClass()} ${getAlignmentClass()} ${containerClassName}`, onClick: handleClick, "data-testid": dataTestId, style: { cursor: onClick ? "pointer" : "default" } },
        React.createElement("div", { className: "flex-shrink-0" },
            React.createElement(Icon, { className: iconClassName, icon: icon, color: iconColor, size: iconSize })),
        React.createElement("div", { className: `flex ${getAlignmentClass()} ${textClassName}`, style: { color: (textColor === null || textColor === void 0 ? void 0 : textColor.toString()) || "inherit" } }, text)));
};
export default IconText;
//# sourceMappingURL=IconText.js.map