import React from "react"; import Pictograms from "./Pictograms"; import { extractTags } from "../../Services"; import { useHistory } from "react-router-dom"; import KeyboardArrowRightIcon from "@material-ui/icons/KeyboardArrowRight"; export default function CardDish(props) { const history = useHistory(); const { name, prices, imgUrl, weight, vegan, vegetarian, allergens, _id, } = props.dish; const FormatPrices = () => { if (prices.price1.priceName === "") { return(
{ prices.price1.price }zł
) } else { return (
{prices.price1.priceName !== "" &&
{prices.price1.price}zł ({ prices.price1.priceName })
} {prices.price2.priceName !== "" &&
{prices.price2.price}zł ({prices.price2.priceName})
} {prices.price3.priceName !== "" &&
{prices.price3.price}zł ({ prices.price3.priceName })
}
) } } return (
history.push(`/dish/${_id}`)} >

{name}

Porcja: {weight}

{(vegan & vegetarian) ? "wegańskie | wegetariańskie" : ""} {(vegan & !vegetarian) ? "wegańskie" : ""} {(!vegan & vegetarian) ? "wegetariańskie" : ""}

); }