"use strict";
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);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultCellValueRenderer = void 0;
var react_1 = __importDefault(require("react"));
var mdm_sdk_1 = require("@reltio/mdm-sdk");
var BlobRenderer_1 = require("../BlobRenderer");
var DataTypeValue_1 = require("../DataTypeValue");
var ExpandedValueTooltip_1 = require("../ExpandedValueTooltip");
var classnames_1 = __importDefault(require("classnames"));
var styles_1 = require("./styles");
var DefaultCellValueRenderer = function (props) {
    var styles = (0, styles_1.useStyles)();
    var value = props.value, _a = props.columnData, dataTypeDefinition = _a.dataTypeDefinition, columnClassName = _a.className, className = props.className;
    switch (dataTypeDefinition.type) {
        case mdm_sdk_1.DataTypes.TYPE_BLOB:
            return react_1.default.createElement(BlobRenderer_1.BlobRenderer, __assign({}, props, { className: columnClassName }));
        default: {
            var dataTypeValue = react_1.default.createElement(DataTypeValue_1.DataTypeValue, { value: value, dataTypeDefinition: dataTypeDefinition });
            return (react_1.default.createElement(ExpandedValueTooltip_1.ExpandedValueTooltip, { value: dataTypeValue },
                react_1.default.createElement("div", { "data-reltio-id": "default-renderer", className: (0, classnames_1.default)(styles.defaultWrapper, className, columnClassName) }, dataTypeValue)));
        }
    }
};
exports.DefaultCellValueRenderer = DefaultCellValueRenderer;
