'use client' import { useState, useTransition } from 'react' import { Button } from '@/components/ui/button' import { leaveProductAction } from '@/actions/products' interface LeaveProductButtonProps { productId: string } export function LeaveProductButton({ productId }: LeaveProductButtonProps) { const [confirming, setConfirming] = useState(false) const [isPending, startTransition] = useTransition() function handleLeave() { startTransition(async () => { await leaveProductAction(productId) }) } if (confirming) { return (