'use client' import { Button } from "@/components/ui/button"; import { Check } from "lucide-react"; import { DeleteButton } from "./DeleteButton"; import { toggleComprado } from "../actions"; import { useRouter } from "next/navigation"; interface Produto { id: number; nome: string; qtd: number; tipoUN: string; comprado: boolean; listaId: string; createdAt: Date; updatedAt: Date; } interface ProductCardProps { produto: Produto; listaId: string; } export function ProductCard({ produto, listaId }: ProductCardProps) { const router = useRouter(); const handleToggleComprado = async () => { await toggleComprado(produto.id, listaId); router.refresh(); }; return (

{produto.nome}

Quantidade: {produto.qtd}

Tipo: {produto.tipoUN}

); }