import { useState } from 'react' import { UpOutlined, DownOutlined } from '@ant-design/icons' import './SideInfoPanel.css' /** * 侧边信息面板组件 * @param {Object} props * @param {Array} props.sections - 信息区块配置数组 * @param {string} props.className - 自定义类名 */ function SideInfoPanel({ sections = [], className = '' }) { const [collapsedSections, setCollapsedSections] = useState(() => { const initial = {} sections.forEach((section) => { if (section.defaultCollapsed) { initial[section.key] = true } }) return initial }) const toggleSection = (key) => { setCollapsedSections((prev) => ({ ...prev, [key]: !prev[key], })) } return (