"use client" import { useState } from "react" import { useRouter } from "next/navigation" import { Trash2 } from "lucide-react" export function DeletePropertyButton({ propertyId }: { propertyId: string }) { const router = useRouter() const [confirming, setConfirming] = useState(false) const [loading, setLoading] = useState(false) async function handleDelete() { setLoading(true) await fetch(`/api/properties/${propertyId}`, { method: "DELETE" }) router.push("/properties") router.refresh() } if (confirming) { return (