'use client'; import { useMarketOutlookSections, type SectionId } from '@/stores/market-outlook-sections-store'; interface SectionCollapseProps { id: SectionId; title: string; children: React.ReactNode; info?: React.ReactNode; } export function SectionCollapse({ id, title, children, info }: SectionCollapseProps) { const open = useMarketOutlookSections((s) => s.open[id]); const toggle = useMarketOutlookSections((s) => s.toggle); return (
toggle(id)} onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); toggle(id); } }} className="flex items-center gap-2 w-full text-left group cursor-pointer" > ▸

{title}

{info && ( e.stopPropagation()} className="inline-flex"> {info} )}
{open &&
{children}
}
); }