"use client"; import { useState } from "react"; export function CopyLinkButton({ path, title = "Copia link" }: { path: string; title?: string }) { const [copied, setCopied] = useState(false); function handleCopy() { const url = typeof window !== "undefined" ? `${window.location.origin}${path}` : path; navigator.clipboard?.writeText(url).then(() => { setCopied(true); setTimeout(() => setCopied(false), 1500); }); } return ( ); }