import { Sparkles } from 'lucide-react'; import type { ParsedIntent } from '../../types/ai-writing'; import type { ArticleType } from '../../api/ai-writing-article-types'; interface IntentResultCardProps { intent: ParsedIntent; articleTypes: ArticleType[]; hideTargetAudience?: boolean; embedded?: boolean; } /** * 意图解析完成后的结构化卡片。展示 LLM 把用户原始意图理解成的四项: * 文章类型 / 目标读者 / 字数 / 精炼意图。在素材收集开始前作为"承上启下"的视觉锚点。 */ export function IntentResultCard({ intent, articleTypes, hideTargetAudience = false, embedded = false, }: IntentResultCardProps) { // article_type 后端给的是 key(如 "analysis"),UI 展示用 label(如 "分析报道") const typeLabel = articleTypes.find((t) => t.key === intent.articleType)?.label ?? intent.articleType; return (
意图解析完成
{!hideTargetAudience && ( )} {intent.refinedIntent && ( )}
); } function Row({ label, value, multiline }: { label: string; value: string; multiline?: boolean }) { return (
{label} {value}
); }