"use client"; import { ArrowRightIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"; import { useState } from "react"; import type { AgentQuestion } from "@/core/agents"; import { desensitize } from "@/lib/desensitize"; import { cn } from "@/lib/utils"; /** Chips shown before the rest folds behind the 更多问题 toggle. */ const VISIBLE_COUNT = 4; /** * 常用问题 prompt chips on the agent chat landing screen — light-gray * borderless pills stacked left-aligned between the welcome hero and the * input box. Clicking a chip sends the question's full prompt through the * page's existing submit flow. Lists longer than {@link VISIBLE_COUNT} fold * behind a 更多问题 toggle; an empty list renders nothing. */ export function AgentQuestionChips({ questions, onAsk, disabled, className, }: { questions: AgentQuestion[]; onAsk: (prompt: string) => void; disabled?: boolean; className?: string; }) { const [expanded, setExpanded] = useState(false); if (questions.length === 0) return null; const visible = expanded ? questions : questions.slice(0, VISIBLE_COUNT); const foldedCount = questions.length - VISIBLE_COUNT; return (