'use strict';

exports.__esModule = true;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _airbnbPropTypes = require('airbnb-prop-types');

require('./style.css');

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

var PageFlipper = function PageFlipper(props) {
  var blank = _react2.default.createElement(
    'div',
    { className: 'ma__page-flipper__blank' },
    '\xA0'
  );
  var prev = props.previousLink || blank;
  var next = props.nextLink || blank;
  return _react2.default.createElement(
    _react2.default.Fragment,
    null,
    props.intro && _react2.default.createElement(
      'div',
      { className: 'ma__page-flipper__context' },
      props.intro.label && _react2.default.createElement(
        'span',
        { className: 'ma__page-flipper__context-label' },
        props.intro.label
      ),
      props.intro.introDecorativeLink && props.intro.introDecorativeLink.props.text && props.intro.introDecorativeLink
    ),
    _react2.default.createElement(
      'div',
      { className: 'ma__page-flipper' },
      _react2.default.createElement(
        'div',
        { className: 'ma__page-flipper__container' },
        prev,
        next
      )
    )
  );
};

PageFlipper.propTypes = process.env.NODE_ENV !== "production" ? {
  /** Introduction section containing a label and / or a link. */
  intro: _propTypes2.default.shape({
    /** Optional label */
    label: _propTypes2.default.string,
    /** Optional DecorativeLink */
    introDecorativeLink: (0, _airbnbPropTypes.componentWithName)('DecorativeLink')
  }),
  /** Previous Link (or left button) */
  previousLink: (0, _airbnbPropTypes.componentWithName)('ArrowNav'),
  /** Nexxt Link (or right button) */
  nextLink: (0, _airbnbPropTypes.componentWithName)('ArrowNav')
} : {};

exports.default = PageFlipper;
module.exports = exports['default'];