import React from 'react';
import {View, Button} from 'react-native';
import {connect} from 'react-redux';
import {addToCart} from './cartActions';

const AddToCartButton = ({product, addToCart}) => {
  return (
    <View>
      <Button title="Add to Cart" onPress={() => addToCart(product)} />
    </View>
  );
};

export default connect(null, {addToCart})(AddToCartButton);
