Add src/app/shop/[productId]/page.tsx

This commit is contained in:
2026-05-30 13:46:37 +00:00
parent d269ace41a
commit 042aaa4994

View File

@@ -0,0 +1,203 @@
"use client";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import ReactLenis from "lenis/react";
import NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple';
import FooterBaseCard from '@/components/sections/footer/FooterBaseCard';
import ProductDetailCard from '@/components/ecommerce/productDetail/ProductDetailCard';
import { Star } from 'lucide-react';
const allProducts = [
{
id: "1", name: "AI Assistant Pro", price: "$49.99", description: "Enhance your daily workflow with an intelligent AI assistant that automates tasks, manages schedules, and provides insightful recommendations.", images: [
{ src: "http://img.b2bpic.net/free-photo/blue-glowing-artificial-intelligence-brain-background_53876-135832.jpg", alt: "AI Assistant Pro software icon" },
{ src: "http://img.b2bpic.net/free-photo/ai-generated-image-neural-network-with-glowing-nodes_23-2151042797.jpg", alt: "AI neural network illustration" }
],
rating: 4.5,
variants: [
{ label: "License Type", options: ["Annual", "Lifetime"], selected: "Annual", onChange: (value: string) => console.log(value) }
],
quantity: { label: "Quantity", options: ["1", "2", "3"], selected: "1", onChange: (value: string) => console.log(value) }
},
{
id: "2", name: "Smart Scheduler Watch", price: "$199.99", description: "A cutting-edge smartwatch designed to integrate seamlessly with your AI Planner, providing on-the-go scheduling, reminders, and notifications directly on your wrist.", images: [
{ src: "http://img.b2bpic.net/free-photo/smartwatch-with-augmented-reality_1134-124.jpg", alt: "Smartwatch displaying a calendar" },
{ src: "http://img.b2bpic.net/free-photo/modern-watch-on-white-table-flat-lay-shot_23-2150334812.jpg", alt: "Modern smartwatch flat lay" }
],
rating: 4.2,
variants: [
{ label: "Color", options: ["Black", "Silver", "Rose Gold"], selected: "Black", onChange: (value: string) => console.log(value) }
],
quantity: { label: "Quantity", options: ["1", "2"], selected: "1", onChange: (value: string) => console.log(value) }
},
{
id: "3", name: "Productivity Boost E-book", price: "$9.99", description: "Unlock the secrets to maximum efficiency with this comprehensive e-book, featuring AI-driven strategies and practical tips to master your time and tasks.", images: [
{ src: "http://img.b2bpic.net/free-photo/close-up-desk-with-book-glasses_23-2148455806.jpg", alt: "E-book on a desk" },
{ src: "http://img.b2bpic.net/free-photo/books-shelf-library-education-reading_1134-118.jpg", alt: "Bookshelf in a library" }
],
rating: 4.8,
variants: [],
quantity: { label: "Quantity", options: ["1", "2", "5"], selected: "1", onChange: (value: string) => console.log(value) }
}
];
interface ProductPageProps {
params: { productId: string };
}
export default function ProductPage({ params }: ProductPageProps) {
const product = allProducts.find(p => p.id === params.productId);
if (!product) {
return (
<ThemeProvider
defaultButtonVariant="bounce-effect"
defaultTextAnimation="entrance-slide"
borderRadius="rounded"
contentWidth="medium"
sizing="largeSmallSizeLargeTitles"
background="fluid"
cardStyle="soft-shadow"
primaryButtonStyle="diagonal-gradient"
secondaryButtonStyle="solid"
headingFontWeight="light"
>
<ReactLenis root>
<NavbarStyleApple
navItems={[
{ name: "Home", id: "#home"},
{ name: "Features", id: "#features"},
{ name: "About", id: "#about"},
{ name: "Pricing", id: "#pricing"},
{ name: "Testimonials", id: "#testimonials"},
{ name: "FAQ", id: "#faq"},
{ name: "Contact", id: "#contact"},
{ name: "Shop", id: "/shop"},
{ name: "Cart", id: "/cart"}
]}
brandName="AI Planner Pro"
/>
<div className="min-h-screen flex items-center justify-center">
<p className="text-2xl font-semibold">Product not found.</p>
</div>
<FooterBaseCard
logoText="AI Planner Pro"
columns={[
{
title: "Product", items: [
{ label: "Features", href: "#features"},
{ label: "Pricing", href: "#pricing"},
{ label: "Integrations", href: "#"},
{ label: "Shop", href: "/shop"}
],
},
{
title: "Company", items: [
{ label: "About Us", href: "#about"},
{ label: "Testimonials", href: "#testimonials"},
{ label: "Careers", href: "#"},
],
},
{
title: "Support", items: [
{ label: "FAQ", href: "#faq"},
{ label: "Contact Us", href: "#contact"},
{ label: "Help Center", href: "#"},
{ label: "Cart", href: "/cart"}
],
},
]}
copyrightText="© 2024 AI Planner Pro. All rights reserved."
onPrivacyClick={() => console.log('Privacy Policy clicked')}
/>
</ReactLenis>
</ThemeProvider>
);
}
return (
<ThemeProvider
defaultButtonVariant="bounce-effect"
defaultTextAnimation="entrance-slide"
borderRadius="rounded"
contentWidth="medium"
sizing="largeSmallSizeLargeTitles"
background="fluid"
cardStyle="soft-shadow"
primaryButtonStyle="diagonal-gradient"
secondaryButtonStyle="solid"
headingFontWeight="light"
>
<ReactLenis root>
<div id="nav" data-section="nav">
<NavbarStyleApple
navItems={[
{ name: "Home", id: "#home"},
{ name: "Features", id: "#features"},
{ name: "About", id: "#about"},
{ name: "Pricing", id: "#pricing"},
{ name: "Testimonials", id: "#testimonials"},
{ name: "FAQ", id: "#faq"},
{ name: "Contact", id: "#contact"},
{ name: "Shop", id: "/shop"},
{ name: "Cart", id: "/cart"}
]}
brandName="AI Planner Pro"
/>
</div>
<div id="product-detail" data-section="product-detail" className="py-20 min-h-screen">
<ProductDetailCard
layout="page"
name={product.name}
price={product.price}
description={product.description}
images={product.images}
rating={product.rating}
ratingIcon={Star}
showRating={true}
variants={product.variants}
quantity={product.quantity}
buttons={[
{ text: "Add to Cart", onClick: () => console.log(`Added ${product.name} to cart`) },
{ text: "Buy Now", onClick: () => console.log(`Buying ${product.name} now`) }
]}
/>
</div>
<div id="footer" data-section="footer">
<FooterBaseCard
logoText="AI Planner Pro"
columns={[
{
title: "Product", items: [
{ label: "Features", href: "#features"},
{ label: "Pricing", href: "#pricing"},
{ label: "Integrations", href: "#"},
{ label: "Shop", href: "/shop"}
],
},
{
title: "Company", items: [
{ label: "About Us", href: "#about"},
{ label: "Testimonials", href: "#testimonials"},
{ label: "Careers", href: "#"},
],
},
{
title: "Support", items: [
{ label: "FAQ", href: "#faq"},
{ label: "Contact Us", href: "#contact"},
{ label: "Help Center", href: "#"},
{ label: "Cart", href: "/cart"}
],
},
]}
copyrightText="© 2024 AI Planner Pro. All rights reserved."
onPrivacyClick={() => console.log('Privacy Policy clicked')}
/>
</div>
</ReactLenis>
</ThemeProvider>
);
}