Browse Source

enh: custom icon support for actions

Timothy J. Baek 9 months ago
parent
commit
3cc3671e74
1 changed files with 10 additions and 1 deletions
  1. 10 1
      src/lib/components/chat/Messages/ResponseMessage.svelte

+ 10 - 1
src/lib/components/chat/Messages/ResponseMessage.svelte

@@ -1034,7 +1034,16 @@
 																dispatch('action', action.id);
 															}}
 														>
-															<Sparkles strokeWidth="2.1" className="size-4" />
+															{#if action.icon_url}
+																<img
+																	src={action.icon_url}
+																	class="w-4 h-4 dark:invert-[80%]"
+																	style="fill: currentColor;"
+																	alt={action.name}
+																/>
+															{:else}
+																<Sparkles strokeWidth="2.1" className="size-4" />
+															{/if}
 														</button>
 													</Tooltip>
 												{/each}