Update src/app/shop/[id]/page.tsx

This commit is contained in:
2026-02-14 00:45:05 +00:00
parent a0cb93163e
commit fb323dac56

View File

@@ -63,7 +63,7 @@ export default function ProductPage({ params }: ProductPageProps) {
await checkout(getCheckoutItems(), { successUrl: currentUrl.toString() });
}, [cartItems, checkout, getCheckoutItems]);
if (isLoading) {
if (isLoading || !product) {
return (
<ThemeProvider
defaultButtonVariant="bounce-effect"
@@ -145,8 +145,19 @@ export default function ProductPage({ params }: ProductPageProps) {
</div>
<div id="productDetail" data-section="productDetail">
<ProductDetailCard
layout="page"
name={product.name}
price={`$${product.price}`}
images={images}
variants={variants}
buttons={[
{
text: "Add to Cart", onClick: handleAddToCart
},
{
text: "Buy Now", onClick: handleBuyNow
}
]}
/>
</div>
<ProductCart