diff --git a/components/publication-card.tsx b/components/publication-card.tsx index e69176de..7e5a41f0 100644 --- a/components/publication-card.tsx +++ b/components/publication-card.tsx @@ -53,6 +53,9 @@ export function PublicationCard({ .then(() => { setCopyStatus("success"); setTimeout(() => setCopyStatus("idle"), 2000); + if (window.umami) { + window.umami.track(`${bibtexKey}-bibtex-copy`); + } }) .catch((err) => { console.error("Failed to copy BibTeX:", err); @@ -75,6 +78,18 @@ export function PublicationCard({ a.click(); document.body.removeChild(a); URL.revokeObjectURL(url); // Clean up immediately + if (window.umami) { + window.umami.track(`${bibtexKey}-bibfile-download`); + } + }; + + const handlePDF = () => { + if (pdfUrl) { + if (window.umami) { + window.umami.track(`${bibtexKey}-pdf-open`); + } + window.open(pdfUrl, "_blank", "noopener,noreferrer"); + } }; const handleCardClick = () => { @@ -137,14 +152,13 @@ export function PublicationCard({
Download BibTeX
@@ -153,18 +167,17 @@ export function PublicationCard({Copy Citation
@@ -178,15 +191,8 @@ export function PublicationCard({ variant={buttonStyle} size={buttonSize} className="h-7 w-7 px-2 hover:border" - onClick={(e) => e.stopPropagation()} - asChild> -