import React from 'react';
import classnames from 'classnames';
import { isComplexAttribute } from '@reltio/mdm-sdk';
import { useCommonStyles } from '../../styles';
import { ValueHeightConsumer } from '../../../../../SyncedValueHeight';
import { SimpleRule } from '../SimpleRule';
import { ComplexRule } from '../ComplexRule';
import styles from './RuleTypeRenderer.module.css';
export var RuleTypeRenderer = function (_a) {
    var _b = _a.value, attributeType = _b.attributeType, attributeValues = _b.attributeValues, getRuleTypeData = _b.getRuleTypeData;
    var commonStyles = useCommonStyles();
    return (React.createElement("div", { className: classnames(styles.list, commonStyles.basicCell) }, attributeValues.length === 0 ? (React.createElement(SimpleRule, { attributeType: attributeType, getRuleTypeData: getRuleTypeData })) : (attributeValues.map(function (attributeValue) { return (React.createElement(ValueHeightConsumer, { key: attributeValue.uri, uri: attributeValue.uri }, isComplexAttribute(attributeType) ? (React.createElement(ComplexRule, { attributeType: attributeType, attributeValue: attributeValue, getRuleTypeData: getRuleTypeData })) : (React.createElement(SimpleRule, { attributeType: attributeType, attributeValue: attributeValue, getRuleTypeData: getRuleTypeData })))); }))));
};
