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; };

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; }

import React from 'react';
import seeds, { Seed } from 'react-seeds';
import Button from './Button';

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

	return React.createElement(Button, {
		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 React.createElement(
		Seed,
		_extends({ Component: 'nav', row: true }, others),
		items.map(function (item, index) {
			return React.createElement(TabItem, _extends({ key: index,
				buttonStyler: buttonStyler
			}, item));
		})
	);
}

export default Tabs;