diff --git a/app/components/RuleCard.js b/app/components/RuleCard.js index 245e7ac..291b90f 100644 --- a/app/components/RuleCard.js +++ b/app/components/RuleCard.js @@ -6,10 +6,43 @@ const RuleCard = ({ icon, backgroundColor = "bg-[var(--color-community-teal-100)]", className = "", + onClick, }) => { + const handleClick = () => { + // Basic analytics event tracking + if (typeof window !== "undefined" && window.gtag) { + window.gtag("event", "template_selected", { + template_name: title, + template_type: "governance_pattern", + }); + } + + // Custom analytics event for other tracking systems + if (typeof window !== "undefined" && window.analytics) { + window.analytics.track("Template Selected", { + templateName: title, + templateType: "governance_pattern", + }); + } + + if (onClick) onClick(); + }; + + const handleKeyDown = (event) => { + if (event.key === "Enter" || event.key === " ") { + event.preventDefault(); + handleClick(); + } + }; + return (
{/* Header Container */}
diff --git a/app/components/RuleStack.js b/app/components/RuleStack.js index c0d6fbf..c85fb1d 100644 --- a/app/components/RuleStack.js +++ b/app/components/RuleStack.js @@ -6,6 +6,12 @@ import Button from "./Button"; import Image from "next/image"; const RuleStack = ({ children, className = "" }) => { + const handleTemplateClick = (templateName) => { + console.log(`Template selected: ${templateName}`); + // This would typically navigate to template details or open a modal + // For now, we'll just log the selection + }; + return (
{ /> } backgroundColor="bg-[var(--color-surface-default-brand-lime)]" + onClick={() => handleTemplateClick("Consensus clusters")} /> { /> } backgroundColor="bg-[var(--color-surface-default-brand-rust)]" + onClick={() => handleTemplateClick("Consensus")} /> { /> } backgroundColor="bg-[var(--color-surface-default-brand-red)]" + onClick={() => handleTemplateClick("Elected Board")} /> { /> } backgroundColor="bg-[var(--color-surface-default-brand-teal)]" + onClick={() => handleTemplateClick("Petition")} />