'use strict';

exports.__esModule = true;

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactSeeds = require('react-seeds');

var _reactSeeds2 = _interopRequireDefault(_reactSeeds);

var _Button = require('./Button');

var _Button2 = _interopRequireDefault(_Button);

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

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

function TabItem(_ref) {
	var title = _ref.title,
	    selected = _ref.selected,
	    onClick = _ref.onClick,
	    buttonStyler = _ref.buttonStyler;

	return _react2.default.createElement(_Button2.default, {
		children: title, selected: selected,
		grow: 1,
		height: 32,
		onClick: onClick,
		styler: buttonStyler
	});
}

function Tabs(_ref2) {
	var items = _ref2.items,
	    buttonStyler = _ref2.buttonStyler,
	    others = _objectWithoutProperties(_ref2, ['items', 'buttonStyler']);

	return _react2.default.createElement(
		_reactSeeds.Seed,
		_extends({ Component: 'nav', row: true }, others),
		items.map(function (item, index) {
			return _react2.default.createElement(TabItem, _extends({ key: index,
				buttonStyler: buttonStyler
			}, item));
		})
	);
}

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