From db3b0757967518756ef7f7c74ded45032ea1c68f Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 11 Jun 2024 12:16:11 -0700 Subject: [PATCH] refac: input menu tools --- .../chat/MessageInput/InputMenu.svelte | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/lib/components/chat/MessageInput/InputMenu.svelte b/src/lib/components/chat/MessageInput/InputMenu.svelte index f0bebd8c0..6f7061bed 100644 --- a/src/lib/components/chat/MessageInput/InputMenu.svelte +++ b/src/lib/components/chat/MessageInput/InputMenu.svelte @@ -46,28 +46,31 @@ transition={flyAndScale} > {#if Object.keys(tools).length > 0} - {#each Object.keys(tools) as toolId} -
-
- +
+ {#each Object.keys(tools) as toolId} +
+
+ - -
{tools[toolId].name}
-
+ +
{tools[toolId].name}
+
+
+ + { + selectedToolIds = e.detail + ? [...selectedToolIds, toolId] + : selectedToolIds.filter((id) => id !== toolId); + }} + />
+ {/each} +
- { - selectedToolIds = e.detail - ? [...selectedToolIds, toolId] - : selectedToolIds.filter((id) => id !== toolId); - }} - /> -
- {/each}
{/if}