(props: {
className?: string;
mode: ContextPanelMode;
processSteps: ProcessStep[];
modelLogs: ModelCallLogRecord[];
onSetMode: (mode: ContextPanelMode) => void;
onRefreshModelLogs: () => void;
onClearModelLogs: () => void;
})
| 2119 | } |
| 2120 | |
| 2121 | function ActivityPanel(props: { |
| 2122 | className?: string; |
| 2123 | mode: ContextPanelMode; |
| 2124 | processSteps: ProcessStep[]; |
| 2125 | modelLogs: ModelCallLogRecord[]; |
| 2126 | onSetMode: (mode: ContextPanelMode) => void; |
| 2127 | onRefreshModelLogs: () => void; |
| 2128 | onClearModelLogs: () => void; |
| 2129 | }) { |
| 2130 | const { t } = useI18n(); |
| 2131 | return ( |
| 2132 | <aside className={cn("flex min-h-0 flex-col bg-background", props.className)}> |
| 2133 | <div className="border-b border-border p-4"> |
| 2134 | <div className="min-w-0"> |
| 2135 | <h2 className="truncate text-sm font-semibold">{contextPanelModeLabel(props.mode, t)}</h2> |
| 2136 | <p className="mt-1 truncate text-xs text-muted-foreground">{t("搜索链路与模型原始调用", "Search trace and raw model calls")}</p> |
| 2137 | </div> |
| 2138 | <div className="mt-3 grid grid-cols-2 rounded-md border border-border p-1"> |
| 2139 | {(["process", "logs"] as ContextPanelMode[]).map((mode) => ( |
| 2140 | <button |
| 2141 | key={mode} |
| 2142 | type="button" |
| 2143 | className={cn( |
| 2144 | "rounded px-2 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-foreground", |
| 2145 | props.mode === mode && "bg-accent text-foreground" |
| 2146 | )} |
| 2147 | onClick={() => props.onSetMode(mode)} |
| 2148 | > |
| 2149 | {contextPanelModeLabel(mode, t)} |
| 2150 | </button> |
| 2151 | ))} |
| 2152 | </div> |
| 2153 | </div> |
| 2154 | |
| 2155 | <div className="min-h-0 flex-1 overflow-y-auto p-4 scrollbar-thin"> |
| 2156 | {props.mode === "logs" ? ( |
| 2157 | <RawLogsPanel |
| 2158 | logs={props.modelLogs} |
| 2159 | onRefresh={props.onRefreshModelLogs} |
| 2160 | onClear={props.onClearModelLogs} |
| 2161 | /> |
| 2162 | ) : ( |
| 2163 | <ProcessPanel steps={props.processSteps} /> |
| 2164 | )} |
| 2165 | </div> |
| 2166 | </aside> |
| 2167 | ); |
| 2168 | } |
| 2169 | |
| 2170 | function ProcessPanel({ steps }: { steps: ProcessStep[] }) { |
| 2171 | const { t } = useI18n(); |
nothing calls this directly
no test coverage detected