diff --git a/frontend/src/components/CardItem.jsx b/frontend/src/components/CardItem.jsx index c5b3478..2d5cd6a 100644 --- a/frontend/src/components/CardItem.jsx +++ b/frontend/src/components/CardItem.jsx @@ -2,7 +2,7 @@ import { useState } from "react"; import Arrow from "../components/Arrow"; import { useNavigate } from "react-router-dom"; -export default function CardItem({ item, onAddToCart }) { +export default function CardItem({ item, onAddToCart, onNavigate }) { const navigate = useNavigate(); const isPiece = item.unit_type === "piece"; const step = isPiece ? 1 : 0.1; @@ -20,11 +20,16 @@ export default function CardItem({ item, onAddToCart }) { ); }; + const handleGoToItem = () => { + if (onNavigate) onNavigate(); + navigate(`/items/${item.id}`); + }; + return (
Загрузка...