import { useState } from 'react'; import { useProviderContext } from '../Provider'; import Style from './style'; import classNames from 'classnames'; import { SparkDownLine, SparkUpLine } from '@agentscope-ai/icons'; import { IconButton } from '@agentscope-ai/design'; export interface IOperateCardProps { /** * @description 头部配置 * @descriptionEn Header Config * @default {} */ header: { className?: string; style?: React.CSSProperties; icon: React.ReactNode; title: React.ReactNode | string; description?: React.ReactNode | string; }, /** * @description 内容配置 * @descriptionEn Body Config * @default {} */ body?: { children?: React.ReactNode; defaultOpen?: boolean; } } function LineBody(props: { children?: React.ReactNode; }) { const { getPrefixCls } = useProviderContext(); const prefixCls = getPrefixCls('operate-card'); return <>
{props.children}
} function OperateCard(props: IOperateCardProps) { const { getPrefixCls } = useProviderContext(); const prefixCls = getPrefixCls('operate-card'); const [open, setOpen] = useState(props.body?.defaultOpen || false); return <>