"use client"; /** * 测试用例顶部紧凑模式选择器:固定脚本 / 用户模拟。 */ import { AudioLines, Check, ChevronDown, MessageSquareText, Mic, Type, Volume2, } from "lucide-react"; import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { TEST_CASE_INPUT_MODE_LABEL, type TestCaseInputMode, } from "@/data/test-suites"; import { cn } from "@/lib/utils"; const FIXED_SCRIPT_OPTIONS: { value: TestCaseInputMode; title: string; description: string; icon: typeof Type; available: boolean; }[] = [ { value: "fixed_script_text", title: "文字", description: "使用固定文字逐轮测试", icon: Type, available: true, }, { value: "fixed_script_turn_voice", title: "逐轮语音", description: "固定文字自动合成为语音", icon: Volume2, available: false, }, { value: "fixed_script_continuous_voice", title: "连续语音", description: "按指定时序连续发送语音", icon: AudioLines, available: false, }, ]; const USER_SIM_OPTIONS: { value: TestCaseInputMode; title: string; description: string; icon: typeof MessageSquareText; available: boolean; }[] = [ { value: "user_sim_text", title: "文字", description: "使用模型模拟文字用户", icon: MessageSquareText, available: false, }, { value: "user_sim_voice", title: "语音", description: "使用模型模拟语音用户", icon: Mic, available: false, }, ]; export function InputModePicker({ value, onChange, }: { value: TestCaseInputMode; onChange: (mode: TestCaseInputMode) => void; }) { return ( 固定脚本 {FIXED_SCRIPT_OPTIONS.map((option) => ( onChange(option.value)} /> ))} 用户模拟 {USER_SIM_OPTIONS.map((option) => ( onChange(option.value)} /> ))} ); } function ModeMenuItem({ selected, title, description, icon: Icon, available, onSelect, }: { selected: boolean; title: string; description: string; icon: typeof Type; available: boolean; onSelect: () => void; }) { return ( ); }