'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.AlignedQuoteBy = exports.BlockQuote = exports.QuoteBy = undefined;

var _lodash = require('lodash');

var _lodash2 = _interopRequireDefault(_lodash);

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

var _Common = {
  "inner-block": "Common__inner-block___2cOrF",
  "disable-inner-block": "Common__disable-inner-block___1MLd0",
  "components": "Common__components___2fQuj",
  "component": "Common__component___3bwMg",
  "hide": "Common__hide___2HyoH",
  "desc-text-color": "Common__desc-text-color___2fV3l",
  "desc-text-block": "Common__desc-text-block___1Z4b-",
  "text-link": "Common__text-link___1jaLy",
  "image": "Common__image___AKB6W",
  "imagediff": "Common__imagediff___2j7tX",
  "slideshow": "Common__slideshow___1Fz23",
  "embeddedcode": "Common__embeddedcode___3Avmp",
  "youtube": "Common__youtube___2oq1n",
  "topic-box": "Common__topic-box___2Q-kN"
};

var _Common2 = _interopRequireDefault(_Common);

var _BlockQuote = {
  "block-quotation-container": "BlockQuote__block-quotation-container___3sXze",
  "block-quotation": "BlockQuote__block-quotation___2OdJm",
  "block-quotation-by": "BlockQuote__block-quotation-by___3F8LW",
  "blockquote": "BlockQuote__blockquote___1DniZ"
};

var _BlockQuote2 = _interopRequireDefault(_BlockQuote);

var _BlockAlignmentWrapper = require('./BlockAlignmentWrapper');

var _BlockAlignmentWrapper2 = _interopRequireDefault(_BlockAlignmentWrapper);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// eslint-disable-next-line

var QuoteBy = exports.QuoteBy = function QuoteBy(_ref) {
  var content = _ref.content;
  var device = _ref.device;
  // eslint-disable-line
  var quote = _lodash2.default.get(content, [0, 'quote']);
  var quoteBy = _lodash2.default.get(content, [0, 'quoteBy']);
  if (!quote) {
    return null;
  }

  return _react2.default.createElement(
    'div',
    { className: (0, _classnames2.default)(_BlockQuote2.default['block-quotation-container']) },
    _react2.default.createElement(
      'div',
      { className: (0, _classnames2.default)(_BlockQuote2.default['block-quotation'], 'text-justify') },
      quote
    ),
    quoteBy ? _react2.default.createElement(
      'div',
      { className: (0, _classnames2.default)(_BlockQuote2.default['block-quotation-by'], 'text-center', _Common2.default['desc-text-block']) },
      quoteBy
    ) : null
  );
};

var BlockQuote = exports.BlockQuote = function BlockQuote(_ref2) {
  var content = _ref2.content;
  var device = _ref2.device;
  // eslint-disable-line
  return _react2.default.createElement('blockquote', { className: (0, _classnames2.default)(_Common2.default['inner-block'], _BlockQuote2.default['blockquote'], 'text-justify'), dangerouslySetInnerHTML: { __html: _lodash2.default.get(content, [0], '') } });
};

var AlignedQuoteBy = exports.AlignedQuoteBy = (0, _BlockAlignmentWrapper2.default)(QuoteBy);