From eca45258a12c8d99e3766ee7eed4286dbeb9599b Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Fri, 17 Apr 2026 13:11:16 +0700 Subject: [PATCH] feat: add image preview modal for product thumbnails in product index page --- .../js/pages/admin/master/product/index.tsx | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/resources/js/pages/admin/master/product/index.tsx b/resources/js/pages/admin/master/product/index.tsx index e1074cd..7566754 100644 --- a/resources/js/pages/admin/master/product/index.tsx +++ b/resources/js/pages/admin/master/product/index.tsx @@ -24,8 +24,11 @@ import { AlertDialogMedia, AlertDialogTitle, } from "@/components/ui/alert-dialog" +import { Dialog, DialogContent } from "@/components/ui/dialog" +import { X } from 'lucide-react'; export default function ProductIndex({ products, categories }: { products: Product[], categories: Category[] }) { + const [selectedImage, setSelectedImage] = useState(null); const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false); const [isBulkDeleteDialogOpen, setIsBulkDeleteDialogOpen] = useState(false); const [productToDelete, setProductToDelete] = useState(null); @@ -80,11 +83,16 @@ export default function ProductIndex({ products, categories }: { products: Produ return (
{product.thumbnail_url ? ( - {product.name} + ) : (
N/A @@ -277,6 +285,24 @@ export default function ProductIndex({ products, categories }: { products: Produ + + setSelectedImage(null)}> + +
+ Preview + +
+
+
); }