diff --git a/src/components/warehouse/product-card.tsx b/src/components/warehouse/product-card.tsx index 0a1b23d..65d21c1 100644 --- a/src/components/warehouse/product-card.tsx +++ b/src/components/warehouse/product-card.tsx @@ -1,12 +1,13 @@ "use client" +import { useState } from 'react' import Image from 'next/image' - import { useMutation } from '@apollo/client' import { Card } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { Badge } from '@/components/ui/badge' import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from '@/components/ui/alert-dialog' +import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog' import { DELETE_PRODUCT } from '@/graphql/mutations' import { Edit3, Trash2, Package, Eye, EyeOff } from 'lucide-react' import { toast } from 'sonner' @@ -41,6 +42,7 @@ interface ProductCardProps { export function ProductCard({ product, onEdit, onDeleted }: ProductCardProps) { const [deleteProduct, { loading: deleting }] = useMutation(DELETE_PRODUCT) + const [imageDialogOpen, setImageDialogOpen] = useState(false) const handleDelete = async () => { try { @@ -80,15 +82,35 @@ export function ProductCard({ product, onEdit, onDeleted }: ProductCardProps) { return ( {/* Изображение товара */} -
+
{product.mainImage || product.images[0] ? ( - {product.name} + + +
+ {product.name} +
+
+ + + {product.name} + +
+ {product.name} +
+
+
) : (
diff --git a/src/components/warehouse/product-form.tsx b/src/components/warehouse/product-form.tsx index fef8b52..9a1611d 100644 --- a/src/components/warehouse/product-form.tsx +++ b/src/components/warehouse/product-form.tsx @@ -451,7 +451,7 @@ export function ProductForm({ product, onSave, onCancel }: ProductFormProps) { alt={`Товар ${index + 1}`} width={200} height={150} - className="w-full aspect-square object-cover rounded-lg" + className="w-full aspect-square object-contain rounded-lg bg-white/5" /> {/* Индикатор главного изображения */}