From 510dbc1d9cc6bb09df2b7e3b5eee206ae18ec664 Mon Sep 17 00:00:00 2001 From: kleap-admin Date: Sun, 18 Jan 2026 13:40:28 +0000 Subject: [PATCH] Update app/product/[id]/page.tsx --- app/product/[id]/page.tsx | 261 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 261 insertions(+) create mode 100644 app/product/[id]/page.tsx diff --git a/app/product/[id]/page.tsx b/app/product/[id]/page.tsx new file mode 100644 index 0000000..d1d12e3 --- /dev/null +++ b/app/product/[id]/page.tsx @@ -0,0 +1,261 @@ +"use client"; +import { Container } from "@/components/container"; +import { Footer } from "@/components/footer"; +import { Button } from "@/components/ui/button"; +import { BlurImage } from "@/components/blur-image"; +import { Badge } from "@/components/badge"; +import { useState } from "react"; +import { ProductCard } from "@/components/product-card"; + +// Mock product data - in real app, this would come from API/database +const productData = { + id: "1", + name: "Modern Velvet Sofa", + price: 899, + originalPrice: 1299, + category: "Living Room", + description: "Elevate your living space with our luxurious Modern Velvet Sofa. Featuring plush velvet upholstery, deep cushioning, and a sturdy hardwood frame, this sofa combines comfort with contemporary style. Perfect for relaxing after a long day or entertaining guests.", + features: [ + "Premium velvet upholstery", + "Solid hardwood frame", + "High-density foam cushions", + "Removable cushion covers", + "Weight capacity: 800 lbs", + "Assembly required (30 minutes)", + ], + dimensions: { + width: "84 inches", + depth: "36 inches", + height: "33 inches", + seatHeight: "18 inches", + }, + colors: ["Navy Blue", "Emerald Green", "Charcoal Gray", "Blush Pink"], + images: [ + "https://images.unsplash.com/photo-1555041469-a586c61ea9bc?w=800&q=80", + "https://images.unsplash.com/photo-1540574163026-643ea20ade25?w=800&q=80", + "https://images.unsplash.com/photo-1567538096630-e0c55bd6374c?w=800&q=80", + ], + inStock: true, + rating: 4.8, + reviews: 127, +}; + +const relatedProducts = [ + { + id: "5", + name: "Minimalist Coffee Table", + price: 299, + image: "https://images.unsplash.com/photo-1532372320572-cda25653a26d?w=600&q=80", + category: "Living Room", + }, + { + id: "6", + name: "Leather Recliner", + price: 799, + originalPrice: 999, + image: "https://images.unsplash.com/photo-1567538096630-e0c55bd6374c?w=600&q=80", + category: "Living Room", + isSale: true, + }, + { + id: "12", + name: "Accent Armchair", + price: 399, + image: "https://images.unsplash.com/photo-1586023492125-27b2c045efd7?w=600&q=80", + category: "Living Room", + }, +]; + +export default function ProductDetailPage() { + const [selectedImage, setSelectedImage] = useState(0); + const [selectedColor, setSelectedColor] = useState(productData.colors[0]); + const [quantity, setQuantity] = useState(1); + + const discount = productData.originalPrice + ? Math.round(((productData.originalPrice - productData.price) / productData.originalPrice) * 100) + : 0; + + return ( + <> +
+ +
+ {/* Product Images */} +
+
+ + {discount > 0 && ( +
+ -{discount}% +
+ )} +
+
+ {productData.images.map((image, index) => ( + + ))} +
+
+ + {/* Product Info */} +
+

+ {productData.category} +

+

{productData.name}

+ +
+
+ ${productData.price} + {productData.originalPrice && ( + + ${productData.originalPrice} + + )} +
+
+ + {productData.rating} + ({productData.reviews} reviews) +
+
+ +

+ {productData.description} +

+ + {/* Color Selection */} +
+

Color: {selectedColor}

+
+ {productData.colors.map((color) => ( + + ))} +
+
+ + {/* Quantity */} +
+

Quantity

+
+ + {quantity} + +
+
+ + {/* Add to Cart */} +
+ + +
+ + {/* Stock Status */} + {productData.inStock ? ( +

+ ✓ In Stock - Ships within 2-3 business days +

+ ) : ( +

+ Out of Stock - Notify me when available +

+ )} + + {/* Features */} +
+

Key Features

+
    + {productData.features.map((feature, index) => ( +
  • + + {feature} +
  • + ))} +
+
+ + {/* Dimensions */} +
+

Dimensions

+
+
+

Width

+

{productData.dimensions.width}

+
+
+

Depth

+

{productData.dimensions.depth}

+
+
+

Height

+

{productData.dimensions.height}

+
+
+

Seat Height

+

{productData.dimensions.seatHeight}

+
+
+
+
+
+ + {/* Related Products */} +
+

You May Also Like

+
+ {relatedProducts.map((product) => ( + + ))} +
+
+
+
+ +