import React from 'react'; import { Modal, ModalOverlay, ModalContent, ModalHeader, ModalBody, ModalCloseButton, Button, Text, Box, Badge, Grid, GridItem, Image, Input, InputGroup, InputLeftElement, VStack, HStack, Select, IconButton, Flex, Icon, // Dibutuhkan untuk membungkus icon dari Lucide } from '@chakra-ui/react'; // Import hanya icon standar UI dari lucide-react (pengganti @chakra-ui/icons) import { Search } from 'lucide-react'; // --- Dummy Data Types --- type Product = { id: string; name: string; price: string; originalPrice: string; image: string; variants: string[]; specs: Record; }; type Props = { isOpen: boolean; onClose: () => void; }; // --- Dummy Data Configuration --- const SPEC_LABELS = [ 'Tipe Baterai', 'Kecepatan Tanpa Beban', 'Torsi Maksimum', 'Ukuran Drive', 'Berat Bersih', 'Garansi', ]; const DUMMY_PRODUCTS: (Product | null)[] = [ { id: '1', name: 'TEKIRO Cordless Impact Wrench 1/2 Inch XV Brushless', price: 'Rp 999.999', originalPrice: 'Rp 1.500.000', image: '/images/no-image-compare.svg', variants: ['Unit Only', '1 Baterai Kit', '2 Baterai Kit'], specs: { 'Tipe Baterai': '20V Lithium-Ion', 'Kecepatan Tanpa Beban': '0-2400 RPM', 'Torsi Maksimum': '300 N.m', 'Ukuran Drive': '1/2 Inch', 'Berat Bersih': '1.5 Kg', 'Garansi': '1 Tahun', }, }, { id: '2', name: 'Makita Cordless Impact Wrench TW001GZ (40V)', price: 'Rp 2.450.000', originalPrice: 'Rp 3.000.000', image: '/images/no-image-compare.svg', variants: ['Unit Only', 'Full Set'], specs: { 'Tipe Baterai': '40V Max XGT', 'Kecepatan Tanpa Beban': '0-2500 RPM', 'Torsi Maksimum': '1350 N.m', 'Ukuran Drive': '3/4 Inch', 'Berat Bersih': '2.8 Kg', 'Garansi': '2 Tahun', }, }, { id: '3', name: 'DEWALT Max Brushless 1/2 High Torque Impact', price: 'Rp 3.100.000', originalPrice: 'Rp 3.500.000', image: '/images/no-image-compare.svg', variants: ['Unit Only'], specs: { 'Tipe Baterai': '20V XR Li-Ion', 'Kecepatan Tanpa Beban': '0-1900 RPM', 'Torsi Maksimum': '950 N.m', 'Ukuran Drive': '1/2 Inch', 'Berat Bersih': '2.6 Kg', 'Garansi': '3 Tahun', }, }, null, // Slot kosong ]; const ProductComparisonModal = ({ isOpen, onClose }: Props) => { return ( Bandingkan Produk Baru Detail Spesifikasi Produk yang kamu pilih {/* Main Grid Layout: 5 Columns */} {/* Cell 1: Top Left Empty Space */} {/* Cell 2-5: Render Products */} {DUMMY_PRODUCTS.map((product, index) => ( {product ? ( // --- KARTU PRODUK TERISI --- {/* Search Bar (Pakai Icon Lucide) */} {/* Gambar Produk */} {product.name} {/* Harga */} {product.price} {product.originalPrice} {/* Nama Produk */} {product.name} {/* Dropdown Varian */} {/* Tombol Aksi (Pakai SVG Custom untuk Keranjang) */} } variant="outline" colorScheme="red" size="sm" w="40px" /> ) : ( // --- SLOT KOSONG --- {/* Placeholder Image (SVG Custom) */} Produk belum ditambahkan )} ))} {/* --- SEPARATOR HEADER SPEC --- */} Spesifikasi Teknis Detail Spesifikasi Produk yang kamu pilih {/* --- TABLE SPEC --- */} {SPEC_LABELS.map((label, rowIndex) => ( {/* Kolom Label */} {label} {/* Kolom Value */} {DUMMY_PRODUCTS.map((product, colIndex) => ( {product ? (product.specs[label] || '-') : '-'} ))} ))} ); }; export default ProductComparisonModal;