zhangjinyang
2025-05-15 35195926da5d6470ccaab09cf25c00a97a3c588a
feat: 添加 AccordionItem 的 description 属性。
2个文件已修改
26 ■■■■■ 已修改文件
aiflowy-ui-react/src/components/Accordion/Accordion.tsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aiflowy-ui-react/src/pages/ai/botDesign/PluginTools.tsx 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aiflowy-ui-react/src/components/Accordion/Accordion.tsx
@@ -7,11 +7,12 @@
 */
export type AccordionItemType = {
    title: string,
    description: string,
    children?: React.ReactNode,
    isActive?: boolean|false,
    clickItem: () => void
}
const AccordionItem: React.FC<AccordionItemType> = ({ title, children, isActive, clickItem }) => {
const AccordionItem: React.FC<AccordionItemType> = ({ title,description, children, isActive, clickItem }) => {
    return (
        <div className={`accordion-item ${isActive ? 'active' : ''}`}>
            <div className="accordion-header" onClick={clickItem}>
@@ -20,7 +21,7 @@
                        <List.Item.Meta
                            avatar={<Avatar src={`https://api.dicebear.com/7.x/miniavs/svg?seed=${1}`} />}
                            title={title}
                            description={"dsadsahgjdshgfjdjh"}
                            description={description}
                        />
                    </List.Item>
                </List>
aiflowy-ui-react/src/pages/ai/botDesign/PluginTools.tsx
@@ -77,14 +77,19 @@
                        <div>
                            {pageData?.data.totalRow > 0 ? pageData?.data.records.map((item: any, index: number) => {
                                return (
                                    <AccordionItem key={index} title={item.name} isActive={selectedIndex == index}
                                                   clickItem={() => {
                                                       if (selectedIndex == index) {
                                                           setSelectedIndex(-1)
                                                       } else {
                                                           setSelectedIndex(index)
                                                       }
                                                   }}>
                                    <AccordionItem
                                        key={index}
                                        title={item.name}
                                        description={item.description}
                                        isActive={selectedIndex == index}
                                        clickItem={() => {
                                            if (selectedIndex == index) {
                                                setSelectedIndex(-1)
                                            } else {
                                                setSelectedIndex(index)
                                            }
                                        }}
                                    >
                                        <List
                                            dataSource={item.tools}
                                            renderItem={(item: any, index) => (