diff --git a/app/products/[id]/page.tsx b/app/products/[id]/page.tsx new file mode 100644 index 0000000..3e3f5b1 --- /dev/null +++ b/app/products/[id]/page.tsx @@ -0,0 +1,132 @@ +"use client"; +import { products } from "@/lib/data"; +import { useCart } from "@/lib/use-cart"; +import { Container } from "@/components/container"; +import { Heading } from "@/components/heading"; +import { Button } from "@/components/ui/button"; +import { Footer } from "@/components/footer"; +import { Star, ShieldCheck, Truck, RotateCcw, ShoppingCart } from "lucide-react"; +import { useParams } from "next/navigation"; +import Link from "next/link"; + +export default function ProductDetailPage() { + const params = useParams(); + const product = products.find((p) => p.id === params.id); + const { addToCart } = useCart(); + + if (!product) { + return ( +
+
+ Product not found + +
+
+ ); + } + + return ( +
+ +
+ {/* Image Gallery */} +
+
+ {product.name} +
+
+ {[1, 2, 3, 4].map((i) => ( +
+ {product.name} +
+ ))} +
+
+ + {/* Product Info */} +
+
+ + {product.category} + +
+ {product.name} + +
+
+ {[...Array(5)].map((_, i) => ( + + ))} + {product.rating} +
+ {product.reviews} Reviews +
+ +
+
+ ₹{product.price} + {product.originalPrice && ( + <> + ₹{product.originalPrice} + + {Math.round(((product.originalPrice - product.price) / product.originalPrice) * 100)}% OFF + + + )} +
+

Inclusive of all taxes

+
+ +

+ {product.description} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +

+ +
+ + +
+ +
+
+
+ +
+
+

Free Delivery

+

Orders over ₹499

+
+
+
+
+ +
+
+

7 Days Return

+

Easy returns policy

+
+
+
+
+ +
+
+

Secure Payment

+

100% safe checkout

+
+
+
+
+
+
+
+ ); +}