import React from 'react'; import { useDispatch } from 'react-redux' import { withRedux } from 'lib/redux'; const addCard = ({ column }) => { const dispatch = useDispatch(); return <> { const userText = window.prompt('New card text:', ''); if (userText !== null) { dispatch({ type: 'ADD_CARD', payload: { column, text: userText }}); } } }>+ Add a card ; } export default withRedux(addCard);