'use strict';

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

var _react = require('react');

var React = _interopRequireWildcard(_react);

var _compose = require('recompose/compose');

var _compose2 = _interopRequireDefault(_compose);

var _setDisplayName = require('recompose/setDisplayName');

var _setDisplayName2 = _interopRequireDefault(_setDisplayName);

var _utils = require('./utils');

var _withStepper = require('./with-stepper');

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

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

var row = {
  display: 'flex',
  alignItems: 'center',
  justifyContent: 'center'
};
/**
 * A component for tracking the current and total pages
 * using dots.
 *
 * ### Usage
 * ```
 * <DotTracker />
 * ```
 */
var DotTracker = exports.DotTracker = (0, _compose2.default)(_withStepper.withStepper, (0, _setDisplayName2.default)('DotTracker'))(function (_ref) {
  var pages = _ref.pages,
      currentPage = _ref.currentPage,
      style = _ref.style,
      _ref$activeColor = _ref.activeColor,
      activeColor = _ref$activeColor === undefined ? _utils.defaultActiveColor : _ref$activeColor,
      _ref$inactiveColor = _ref.inactiveColor,
      inactiveColor = _ref$inactiveColor === undefined ? _utils.defaultInactiveColor : _ref$inactiveColor;
  return React.createElement("div", { style: style ? Object.assign({}, row, style) : row }, Array.from(Array(pages.length)).map(function (_, i) {
    return React.createElement(_utils.Circle, { key: i, color: i === currentPage ? activeColor : inactiveColor, size: 8, margin: 4 });
  }));
});
//# sourceMappingURL=dot-tracker.js.map
