"use client"; import { memo } from "react"; interface RuleCardProps { title: string; description?: string; icon?: React.ReactNode; backgroundColor?: string; className?: string; onClick?: () => void; } declare global { interface Window { gtag?: ( command: string, eventName: string, params?: Record, ) => void; analytics?: { track: (eventName: string, params?: Record) => void; }; } } const RuleCard = memo( ({ title, description, 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: React.KeyboardEvent) => { if (event.key === "Enter" || event.key === " ") { event.preventDefault(); handleClick(); } }; return (
{/* Header Container */}
{/* Icon Container */} {icon && (
{icon}
)} {/* Title Container */} {title && (

{title}

)}
{description && (

{description}

)}
); }, ); RuleCard.displayName = "RuleCard"; export default RuleCard;