({
call,
active,
onClick,
}: {
call: ToolCall;
active: boolean;
onClick: () => void;
})
| 133 | } |
| 134 | |
| 135 | function ToolRunCard({ |
| 136 | call, |
| 137 | active, |
| 138 | onClick, |
| 139 | }: { |
| 140 | call: ToolCall; |
| 141 | active: boolean; |
| 142 | onClick: () => void; |
| 143 | }) { |
| 144 | const title = call.title || call.name || '工具'; |
| 145 | const preview = trimText(call.resultPreview || call.inputPreview, '暂无摘要'); |
| 146 | |
| 147 | return ( |
| 148 | <button |
| 149 | type="button" |
| 150 | onClick={onClick} |
| 151 | className={[ |
| 152 | 'w-full rounded-2xl border px-3 py-3 text-left transition-colors', |
| 153 | active |
| 154 | ? 'border-[#DCCFBE] bg-[#F5EFE4]' |
| 155 | : 'border-[#ECE2D6] bg-white/80 hover:bg-[#FCFAF6]', |
| 156 | ].join(' ')} |
| 157 | > |
| 158 | <div className="flex items-start justify-between gap-3"> |
| 159 | <div className="min-w-0"> |
| 160 | <div className="truncate text-[13px] font-medium text-[#2C241C]">{title}</div> |
| 161 | <div className="mt-1 line-clamp-2 text-[11px] leading-5 text-[#8A7F70]">{preview}</div> |
| 162 | </div> |
| 163 | <span className={['rounded-full border px-2 py-0.5 text-[10px]', toolStatusTone(call.status)].join(' ')}> |
| 164 | {toolStatusLabel(call.status)} |
| 165 | </span> |
| 166 | </div> |
| 167 | </button> |
| 168 | ); |
| 169 | } |
| 170 | |
| 171 | function FileDiffDetail({ file }: { file: FileArtifact | null }) { |
| 172 | if (!file) { |
nothing calls this directly
no test coverage detected