import _isEmpty from "lodash/fp/isEmpty";
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
import React from 'react';
import PropTypes from 'prop-types';
import ForumPost from '../forum-post';
import style from './style.css';
const ForumThread = props => {
  const {
    answers = [],
    mainPost = false
  } = props;
  const answersView = answers.map(answerProps => /*#__PURE__*/React.createElement(ForumThread, _extends({}, answerProps, {
    key: answerProps.id
  })));
  return /*#__PURE__*/React.createElement("div", {
    className: mainPost ? style.mainPost : null
  }, /*#__PURE__*/React.createElement(ForumPost, _extends({}, props, {
    mainPost: mainPost && !_isEmpty(answers)
  })), /*#__PURE__*/React.createElement("div", {
    "data-name": "forumAnswers",
    className: style.answers
  }, answersView));
};
ForumThread.propTypes = process.env.NODE_ENV !== "production" ? {
  answers: PropTypes.arrayOf(PropTypes.shape(ForumThread.propTypes)),
  mainPost: PropTypes.bool
} : {};
export default ForumThread;
//# sourceMappingURL=index.js.map