Update Rule Card component

This commit is contained in:
adilallo
2026-02-04 21:19:27 -07:00
parent 3db151b40c
commit 769fc8e7c6
7 changed files with 584 additions and 243 deletions
@@ -3,6 +3,7 @@
import { memo } from "react";
import { RuleCardView } from "./RuleCard.view";
import type { RuleCardProps } from "./RuleCard.types";
import { normalizeRuleCardSize } from "../../../lib/propNormalization";
declare global {
interface Window {
@@ -25,7 +26,18 @@ const RuleCardContainer = memo<RuleCardProps>(
backgroundColor = "bg-[var(--color-community-teal-100)]",
className = "",
onClick,
expanded = false,
size: sizeProp,
categories,
onPillClick,
onCreateClick,
logoUrl,
logoAlt,
communityInitials,
}) => {
// Normalize size prop
const size = normalizeRuleCardSize(sizeProp, "L");
const handleClick = () => {
// Basic analytics event tracking
if (typeof window !== "undefined" && window.gtag) {
@@ -62,6 +74,14 @@ const RuleCardContainer = memo<RuleCardProps>(
className={className}
onClick={handleClick}
onKeyDown={handleKeyDown}
expanded={expanded}
size={size}
categories={categories}
onPillClick={onPillClick}
onCreateClick={onCreateClick}
logoUrl={logoUrl}
logoAlt={logoAlt}
communityInitials={communityInitials}
/>
);
},