import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _createClass from 'babel-runtime/helpers/createClass';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
var _jsxFileName = 'src/table/TableCell.jsx';
import React from 'react';
import PropTypes from 'prop-types';
import isFunction from 'lodash/isFunction';

/**
 * @ignore
 * */

var TD = function (_React$Component) {
    _inherits(TD, _React$Component);

    function TD() {
        _classCallCheck(this, TD);

        return _possibleConstructorReturn(this, (TD.__proto__ || Object.getPrototypeOf(TD)).apply(this, arguments));
    }

    _createClass(TD, [{
        key: 'render',
        value: function render() {
            var _props = this.props,
                content = _props.content,
                render = _props.render,
                other = _objectWithoutProperties(_props, ['content', 'render']);

            return React.createElement(
                'td',
                Object.assign({}, other, {
                    __source: {
                        fileName: _jsxFileName,
                        lineNumber: 23
                    },
                    __self: this
                }),
                isFunction(render) ? render(content) : content
            );
        }
    }]);

    return TD;
}(React.Component);

TD.defaultProps = {};
TD.propTypes = {
    content: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array, PropTypes.bool, PropTypes.object]),
    render: PropTypes.func
};


export default TD;