Skip to content

Commit

Permalink
feat: add tracking analytics in projects
Browse files Browse the repository at this point in the history
  • Loading branch information
NedcloarBR committed Jan 14, 2025
1 parent 3f48c07 commit aa57a55
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/components/projects/small-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Project } from "@/@types";
import { ProjectsFullCard } from "./full-card";
import { useState } from "react";
import { useTranslations } from "next-intl";
import { track } from "@vercel/analytics";

interface ProjectsSmallCardProps {
info: Project
Expand All @@ -24,9 +25,18 @@ export function ProjectsSmallCard({ info }: Readonly<ProjectsSmallCardProps>) {
const openState = useState(false);
const t = useTranslations("Projects");

function handleClick() {
track("Projects", {
action: "click",
category: "Projects",
label: info.name,
});
openState[1](true);
}

return (
<>
<Card className="w-[230px] card-hover cursor-pointer" onClick={() => openState[1](true)}>
<Card className="w-[230px] card-hover cursor-pointer" onClick={handleClick}>
<CardHeader>
<img src={`images/${info.name}/Logo.png`} alt={`${info.name} Logo`} className="w-[210px] h-[90px] rounded-sm" />
<Separator />
Expand Down

0 comments on commit aa57a55

Please sign in to comment.