import { useEffect, useRef } from "react"; import { X } from "lucide-react"; import type { PolicySection } from "../types"; // Side drawer (mirrors AuditHistory) that doubles as the acronym glossary + full policy reference. // Cited rule IDs in the decision card link here via `focusRule`, which scrolls to and highlights // the matching rule row with the gold "seal" accent. export function PolicyReference({ sections, focusRule, onClose, }: { sections: PolicySection[]; focusRule: string | null; onClose: () => void; }) { const rowRefs = useRef>({}); useEffect(() => { if (focusRule) rowRefs.current[focusRule]?.scrollIntoView({ block: "center" }); }, [focusRule, sections]); return ( ); }