import * as React from 'react';
import { map } from 'lodash';
import { BtnBarContainer, Button } from "./styles";
import { ButtonData } from "./index";

const ButtonBar = ({ buttons, theme }) => {
	return (
		<BtnBarContainer>
			{map(buttons, (btn: ButtonData) => {
				return (
					<Button theme={theme} type={btn.text.toUpperCase()} onClick={() => btn.action(btn.text)}>{btn.text}</Button>
				)
			})}
		</BtnBarContainer>
	)
};

export default ButtonBar;