11<script setup lang="ts">
2- import { IconArrowDown , IconCancelled , IconError , IconLoading , IconPlugin } from ' @opentiny/tiny-robot-svgs'
2+ import {
3+ IconArrowDown ,
4+ IconCancelled ,
5+ IconClose ,
6+ IconError ,
7+ IconLoading ,
8+ IconPlugin ,
9+ IconWarning ,
10+ } from ' @opentiny/tiny-robot-svgs'
311import { type Component , computed , nextTick , ref , useCssModule , watch , watchEffect } from ' vue'
412import { ToolCallStatus , useBubbleEventFn , useToolCall } from ' ../composables'
513import { BubbleContentRendererProps , ChatMessageContent } from ' ../index.type'
@@ -22,8 +30,14 @@ const textAndIconMap = new Map<string, { text: string; icon: Component }>([
2230 [' cancelled' , { text: ' 已取消' , icon: IconCancelled }],
2331])
2432
33+ const approvalTextAndIconMap = new Map <string , { text: string ; icon: Component }>([
34+ [' awaiting-approval' , { text: ' 等待确认' , icon: IconWarning }],
35+ [' denied' , { text: ' 已拒绝' , icon: IconClose }],
36+ ])
37+
2538const textAndIcon = computed (() => {
26- return textAndIconMap .get (state .value ?.status || ' ' ) || { text: ' ' , icon: IconPlugin }
39+ const status = state .value ?.status || ' '
40+ return textAndIconMap .get (status ) || approvalTextAndIconMap .get (status ) || { text: ' ' , icon: IconPlugin }
2741})
2842
2943const prettyJSON = (json : unknown , space = 2 ) => {
@@ -193,6 +207,7 @@ const handleClick = () => {
193207 flex-shrink : 0 ;
194208 display : flex ;
195209 align-items : center ;
210+ gap : 8px ;
196211 }
197212
198213 .header-icon {
@@ -209,9 +224,14 @@ const handleClick = () => {
209224 }
210225
211226 & .icon-failed ,
212- & .icon-cancelled {
227+ & .icon-cancelled ,
228+ & .icon-denied {
213229 color : var (--tr-color-error );
214230 }
231+
232+ & .icon-awaiting-approval {
233+ color : var (--tr-color-warning , #e6a23c );
234+ }
215235 }
216236
217237 .expand-icon {
0 commit comments