import React from 'react'; import styled from 'styled-components'; import slugify from 'slugify'; import { compose } from 'react-apollo'; import { Link } from '../routes'; import AddToCart from './AddToCart'; import makeImage from '../lib/image'; import formatMoney from '../lib/formatMoney'; import { removeItemMutation } from '../enhancers/enhancers'; const Item = styled.div` background: #f3f3f3; padding: 5px; img { width: 100%; } `; class ItemComponent extends React.Component { removeItem = () => { this.props.removeItem({ variables: { id: this.props.item.id } }); }; render() { const item = this.props.item; return ( {item.image ? {item.title} : null}

{item.title}

{item.description}

Edit ✏️
); } } export default compose(removeItemMutation)(ItemComponent);