From 1bb9f0259bac15866e753a86e57d3e4b194e0a02 Mon Sep 17 00:00:00 2001 From: kleap-admin Date: Sun, 18 Jan 2026 18:27:58 +0000 Subject: [PATCH] Update app/products/[id]/page.tsx --- app/products/[id]/page.tsx | 132 +++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 app/products/[id]/page.tsx 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

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