import type { HTMLAttributes } from 'react' import { ResponseRootProvider, useResponseContext, DEMO_ROUNDS, DEMO_FINAL_MD } from './context' import { ResponseThinking, ResponseSteps, ResponseStepComponent, ResponseContent, ResponseImageGenerating, ResponseDefaultLayout, } from './compound' import type { ResponseProps, ResponseCompound, ResponsePhase, ResponseStep, ResponseStepToolType, ResponseRound, ResponseBlock, BlockType, } from './types' // ===== Response 便捷组件 ===== function ResponseBase({ simulate, phase, rounds, finalMarkdown, onSimulateComplete, onStepChange, thinkingIndicator, className, ...props }: ResponseProps & HTMLAttributes) { return (
) } ResponseBase.displayName = 'Response' // ===== 挂载复合组件 ===== type ResponseBaseType = React.FC> & Partial const ResponseWithSlots = ResponseBase as ResponseBaseType ResponseWithSlots.Root = ResponseRootProvider ResponseWithSlots.Thinking = ResponseThinking ResponseWithSlots.Steps = ResponseSteps ResponseWithSlots.Step = ResponseStepComponent ResponseWithSlots.Content = ResponseContent ResponseWithSlots.ImageGenerating = ResponseImageGenerating ResponseWithSlots.DefaultLayout = ResponseDefaultLayout export const Response = ResponseWithSlots as React.FC< ResponseProps & HTMLAttributes > & ResponseCompound export const AssistantResponse = Response export type AssistantResponseProps = ResponseProps // ===== 导出类型和工具 ===== export type { ResponseProps, ResponsePhase, ResponseStep, ResponseStepToolType, ResponseRound, ResponseBlock, BlockType, ResponseCompound, } export { useResponseContext, DEMO_ROUNDS, DEMO_FINAL_MD }