Alaguraj0361 107f07c035
Some checks failed
Build and Deploy Build Output / build (push) Has been cancelled
first commit
2025-09-26 21:09:39 +05:30

28 lines
614 B
JavaScript

"use client";
import { memo, useState } from "react";
const PlusMinusBtn = () => {
const [value, setValue] = useState(1);
return (
<div className="quantity-input">
<button
className="quantity-down"
onClick={() => setValue(value == 1 ? 1 : value - 1)}
>
--
</button>
<input
className="quantity"
type="text"
defaultValue={1}
value={value}
name="quantity"
/>
<button className="quantity-up" onClick={() => setValue(value + 1)}>
+
</button>
</div>
);
};
export default memo(PlusMinusBtn);