import { Link } from "react-router-dom"; import defaultGoodImage from "../../../images/default-good-image.png"; import { Grid, Box, Typography } from "@mui/material"; import { backendURL, mediaURL } from "../../../helpers"; export const SearchGoodResultItem = ({ good, onClick, link = "" } = {}) => { const { _id = 0, images = [], name = "", description = "", price = "" } = good || {}; return ( onClick && onClick()} spacing={1} > { currentTarget.onerror = null; currentTarget.src = defaultGoodImage; }} /> {name.length > 30 ? `${name.substring(0, 30)}...` : name} {description.length > 70 ? `${description.substring(0, 70)}...` : description} {price} ₴ ); };