import { Card, CardActionArea, CardActions, CardContent, CardMedia, Typography } from "@mui/material"; import { connect } from "react-redux"; import { Link } from "react-router-dom"; import { backendURL, mediaURL } from "../../../helpers"; import defaultGoodImage from "../../../images/default-good-image.png"; import { actionCartAdd } from "../../../reducers"; import { CBuyButton } from "../BuyButton"; const GoodCard = ({ good = {} }) => { return ( { currentTarget.onerror = null; currentTarget.src = defaultGoodImage; }} /> Назва: {good.name?.length > 10 ? `${good.name.slice(0, 10)}...` : good.name} Ціна: {good.price} ₴ ); }; const CGoodCard = connect(null, { handleOnClick: (good) => actionCartAdd(good), })(GoodCard); export { GoodCard, CGoodCard };