diff --git a/frontend/src/components/CardItem.jsx b/frontend/src/components/CardItem.jsx index 99a7e77..46b64c6 100644 --- a/frontend/src/components/CardItem.jsx +++ b/frontend/src/components/CardItem.jsx @@ -1,79 +1,87 @@ -import { useState } from 'react'; +import { useState } from "react"; +import Arrow from "../components/Arrow"; export default function CardItem({ item, onAddToCart }) { // Начальный вес — 100 грамм (0.100 кг) - const [weight, setWeight] = useState(0.100); + const [weight, setWeight] = useState(0.1); // Увеличение веса с шагом 100 грамм const handleIncrement = () => { - setWeight((prev) => parseFloat((prev + 0.100).toFixed(3))); + setWeight((prev) => parseFloat((prev + 0.1).toFixed(3))); }; // Уменьшение веса (не позволяет опуститься ниже минимальных 100 грамм) const handleDecrement = () => { - setWeight((prev) => (prev > 0.100 ? parseFloat((prev - 0.100).toFixed(3)) : 0.100)); + setWeight((prev) => + prev > 0.1 ? parseFloat((prev - 0.1).toFixed(3)) : 0.1, + ); }; return ( -