From 629133beeb7f5668b63db61e415cf844d513cde7 Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Thu, 27 Nov 2025 14:30:30 +0700 Subject: (andri) view from magento --- .../product-detail/components/ProductDetail.tsx | 127 +++++++++++++++++---- 1 file changed, 103 insertions(+), 24 deletions(-) (limited to 'src-migrate/modules/product-detail/components/ProductDetail.tsx') diff --git a/src-migrate/modules/product-detail/components/ProductDetail.tsx b/src-migrate/modules/product-detail/components/ProductDetail.tsx index e4ba2b2f..1bacd2e2 100644 --- a/src-migrate/modules/product-detail/components/ProductDetail.tsx +++ b/src-migrate/modules/product-detail/components/ProductDetail.tsx @@ -4,9 +4,22 @@ import Link from 'next/link'; import { useRouter } from 'next/router'; import { useEffect, useRef, useState, UIEvent } from 'react'; -import { Button } from '@chakra-ui/react'; +// Import komponen Chakra UI yang dibutuhkan +import { + Button, + Tabs, + TabList, + TabPanels, + Tab, + TabPanel, + Table, + Tbody, + Tr, + Td, + Box +} from '@chakra-ui/react'; + import { - AlertCircle, AlertTriangle, MessageCircleIcon, Share2Icon, @@ -62,7 +75,6 @@ const ProductDetail = ({ product }: Props) => { setIsApproval, isApproval, setSelectedVariant, - setSla, } = useProductDetail(); useEffect(() => { @@ -136,11 +148,15 @@ const ProductDetail = ({ product }: Props) => { const scrollToIndex = (i: number) => { const el = sliderRef.current; if (!el) return; - el.scrollTo({ left: i * el.clientWidth, behavior: 'smooth' }); + const elRef = sliderRef.current; + elRef.scrollTo({ left: i * elRef.clientWidth, behavior: 'smooth' }); setCurrentIdx(i); setMainImage(allImages[i] || ''); }; + console.log('detail product render'); + console.log('product: ', product); + return ( <>
@@ -195,7 +211,6 @@ const ProductDetail = ({ product }: Props) => { key={i} className='w-full flex-shrink-0 snap-center flex justify-center items-center' > - {/* gambar diperkecil */} {`Gambar { )}
- {/* Dots indicator */} {allImages.length > 1 && (
{allImages.map((_, i) => ( @@ -238,8 +252,6 @@ const ProductDetail = ({ product }: Props) => { <> {/* === DESKTOP: Tetap seperti sebelumnya === */} - - {/* Carousel horizontal (thumbnail) – hanya desktop */} {allImages.length > 0 && (
@@ -271,7 +283,6 @@ const ProductDetail = ({ product }: Props) => { )}
- {/* <<=== TUTUP kolom kiri */} {/* ===== Kolom kanan: info ===== */} {isDesktop && ( @@ -332,21 +343,89 @@ const ProductDetail = ({ product }: Props) => {
+ {/* === SECTION TABS: DESKRIPSI & SPESIFIKASI === */}
-

Informasi Produk

-
-
-

' - ? 'Belum ada deskripsi' - : product.description, - }} - /> -
+ + {/* Header Tabs */} + + + Deskripsi + + + Spesifikasi + + + Detail Lainnya + + + + + {/* PANEL 1: DESKRIPSI */} + +
+

' + ? '

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

' + : product.description, + }} + /> +
+ + + {/* PANEL 2: SPESIFIKASI (Sesuai Gambar) */} + +

Informasi tambahan belum tersedia.

+
+ + {/* PANEL 3: DETAIL LAINNYA */} + +

Informasi tambahan belum tersedia.

+
+ + +
@@ -422,4 +501,4 @@ const ProductDetail = ({ product }: Props) => { ); }; -export default ProductDetail; +export default ProductDetail; \ No newline at end of file -- cgit v1.2.3