'use client'; import { JURISDICTION_COLORS, JURISDICTION_LABELS } from '@/lib/constants'; import type { GraphNode, SectionContent } from '@/lib/types'; interface Props { node: GraphNode; sectionContent: SectionContent | null; isSectionLoading: boolean; onChatAboutSection: (sectionId: string, title: string, docName: string, jurisdiction: string) => void; onClose: () => void; } export function NodeInfoCard({ node, sectionContent, isSectionLoading, onChatAboutSection, onClose, }: Props) { const color = JURISDICTION_COLORS[node.jurisdiction] ?? '#888'; const refsOut = sectionContent?.connected_sections.filter(s => s.edge_type === 'REFERENCES_OUT') ?? []; const refsIn = sectionContent?.connected_sections.filter(s => s.edge_type === 'REFERENCES_IN') ?? []; const derivedOut = sectionContent?.connected_sections.filter(s => s.edge_type === 'DERIVED_FROM_OUT') ?? []; const derivedIn = sectionContent?.connected_sections.filter(s => s.edge_type === 'DERIVED_FROM_IN') ?? []; const hasRelationships = refsOut.length > 0 || refsIn.length > 0 || derivedOut.length > 0 || derivedIn.length > 0; return ( ); } function RelationshipGroup({ label, values }: { label: string; values: string[] }) { return (
{label}
{values.map(value => `Sec ${value}`).join(', ')}