BurgerBuilder/src/components/Burger/BuildControls/BuildControls.js

24 lines
613 B
JavaScript

import React from 'react'
import BuildControl from './BuildControl/BuildControl';
import classes from './BuildControls.css';
const controls = [
{ name: 'Salad', type: 'salad'},
{ name: 'Cheese', type: 'cheese'},
{ name: 'Bacon', type: 'bacon'},
{ name: 'Meat', type: 'meat'},
];
const buildControls = (props) => (
<div className={classes.BuildControls}>
{controls.map( ctrl => (
<BuildControl
key={ctrl.name}
name={ctrl.name}
added={() => props.ingredientAdded(ctrl.type) }/>
))}
</div>
)
export default buildControls;