import { useState } from 'react'; interface AIPanelProps { text: string; loading: boolean; error: string | null; isFallback: boolean; question: string; onCopy: (text: string) => void; onStop: () => void; onClose: () => void; } export default function AIPanel({ text, loading, error, isFallback, question, onCopy, onStop, onClose, }: AIPanelProps) { const [copied, setCopied] = useState(false); const handleCopy = () => { onCopy(text); setCopied(true); setTimeout(() => setCopied(false), 1000); }; return (
针对:{question}
)} {/* Fallback notice */} {isFallback && (⚠️ AI 服务暂时不可用
{error}
请直接使用上方知识库原始答案。
正在检索知识库并调用 DeepSeek…
) : ({text} {/* Blinking cursor while streaming */} {loading && ( )}
)}