var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
import React from 'react';
import classnames from 'classnames';
import DragIndicatorIcon from '@mui/icons-material/DragIndicator';
import { ReadOnlyAttributeValuesBlock } from '../../../../../ReadOnlyAttributeValuesBlock';
import { AttributeTitle } from '../../../../../AttributeTitle';
import { EntityContext } from '../../../../../contexts/EntityContext';
import { useMdmEntity } from '../../../../../contexts/MdmModuleContext';
import { FallbackIndicator } from '../FallbackIndicator';
import { useCommonStyles } from '../../styles';
import { ValueHeightReporter } from '../SyncedValueHeight';
import { useStyles } from './styles';
export var OvValuesRenderer = function (_a) {
    var _b = _a.value, values = _b.values, attributeType = _b.attributeType, someRowIsDragging = _a.someRowIsDragging, draggableProps = _a.draggableProps;
    var styles = useStyles();
    var commonStyles = useCommonStyles();
    var entity = useMdmEntity();
    return (React.createElement("div", { className: classnames(styles.root, commonStyles.basicCell) },
        React.createElement("div", __assign({}, draggableProps, { className: styles.dragIndicator }),
            React.createElement(DragIndicatorIcon, { className: styles.dragIndicatorIcon })),
        React.createElement(AttributeTitle, { className: styles.attributeTitle, label: attributeType.label }),
        !someRowIsDragging && (React.createElement(EntityContext.Provider, { value: entity },
            React.createElement(ReadOnlyAttributeValuesBlock, { values: values, attributeType: attributeType, valueContainerClassName: styles.ovValue, AttributeValueWrapper: ValueHeightReporter, FallbackSlot: FallbackIndicator })))));
};
