Files
feat-2Fn8n-integration/src/components/product-page/Header/AddToCardSection.tsx
Mohammad Oftadeh 66f531e5aa Initial commit
2024-09-26 10:17:47 +03:00

20 lines
697 B
TypeScript

"use client";
import CartCounter from "@/components/ui/CartCounter";
import React, { useState } from "react";
import AddToCartBtn from "./AddToCartBtn";
import { Product } from "@/types/product.types";
const AddToCardSection = ({ data }: { data: Product }) => {
const [quantity, setQuantity] = useState<number>(1);
return (
<div className="fixed md:relative w-full bg-white border-t md:border-none border-black/5 bottom-0 left-0 p-4 md:p-0 z-10 flex items-center justify-between sm:justify-start md:justify-center">
<CartCounter onAdd={setQuantity} onRemove={setQuantity} />
<AddToCartBtn data={{ ...data, quantity }} />
</div>
);
};
export default AddToCardSection;