// QuickQueryHelper.tsx — 快捷查询语法助手 // Logan.Li import { useState } from 'react'; import { ChevronDown, ChevronUp, Zap } from 'lucide-react'; import type { LogEngine } from './types-v3'; import { QUICK_TEMPLATES } from './types-v3'; interface Props { engine: LogEngine; onSelect: (query: string) => void; } const ENGINE_NAMES: Record = { loki: 'LogQL', elasticsearch: 'Lucene', sls: 'SQL/SPL', }; export function QuickQueryHelper({ engine, onSelect }: Props) { const [open, setOpen] = useState(false); const templates = QUICK_TEMPLATES[engine]; return (
{open && (

{ENGINE_NAMES[engine]} 常用查询模板,点击快速填充

{templates.map((t, i) => ( ))}
)}
); }