import { Button } from '@agentscope-ai/design'; import { createStyles } from 'antd-style'; import { ReactNode, useCallback, useState } from 'react'; import { HistoryPanel } from '@agentscope-ai/chat'; import { SparkDeleteLine, SparkEditLine, SparkPlusLine } from '@agentscope-ai/icons'; import defaultData from './mock.json'; const useStyles = createStyles(({ token }) => { return { layout: { display: 'flex', height: 416, border: `1px solid ${token.colorBorderSecondary}`, borderRadius: 8, overflow: 'hidden', }, left: { display: 'flex', flexDirection: 'column', width: 280, background: token.colorBgLayout, }, header: { margin: '16px 20px 8px 20px', height: 32, display: 'flex', alignItems: 'center', gap: 8, fontSize: 16, }, btn: { margin: '0 20px 16px 20px', }, list: { height: 0, flex: 1, overflowY: 'scroll', padding: '0 16px 16px 20px', '&::-webkit-scrollbar': { width: 4, }, '&::-webkit-scrollbar-thumb': { backgroundColor: 'transparent !important', '&:hover': { backgroundColor: `${token.colorFill} !important`, } }, } }; }); function Layout(props: { children: ReactNode }) { const { styles, cx, theme } = useStyles(); return
{props.children}
} export default function () { const [selectable, setSelectable] = useState(true); const { styles, cx, theme } = useStyles(); const [selectedKeys, setSelectedKeys] = useState([]); const handleSelectChange = useCallback((keys: string[]) => { setSelectedKeys(keys); }, []); return
SPARK CHAT
, onEdit: (label: string) => { if (label) return Promise.resolve(); return Promise.reject(); }, }, { label: '删除', key: 'delete', icon: , danger: true, onClick: (session) => { console.log(session); }, }, ]} items={defaultData} defaultActiveKey="item1" />
}