import * as React from 'react';
import { Tag } from '../../../../../components/Tag';
import { useAdaptable } from '../../../../AdaptableContext';
import { Box, Flex } from '../../../../../components/Flex';
export const StyledColumnBadgeSettings = ({ data }) => {
    const adaptable = useAdaptable();
    const badgeStyle = data.BadgeStyle;
    if (!badgeStyle || badgeStyle.Badges.length === 0) {
        return React.createElement("div", null, "No Badges Defined");
    }
    return (React.createElement(Flex, { flexDirection: "column" }, badgeStyle.Badges.map((badge, index) => {
        let ruleString = 'No Rule';
        if (badge.Predicate) {
            ruleString = adaptable.api.predicateApi.predicateToString(badge.Predicate);
        }
        if (badge.Expression) {
            ruleString = badge.Expression.BooleanExpression;
        }
        const iconOnly = badge.Icon && badge.IconOnly;
        const hasIconPosition = badge.Icon && badge.IconPosition;
        const iconPosition = hasIconPosition ? 'Icon Position: ' + badge.IconPosition : '';
        return (React.createElement(Box, { className: "twa:my-2", key: index },
            React.createElement(Tag, null, ruleString),
            iconOnly && React.createElement(Tag, { className: "twa:ml-2" }, 'Icon Only'),
            hasIconPosition && React.createElement(Tag, { className: "twa:ml-2" }, iconPosition)));
    })));
};
