|
1 | 1 | import { useFilteredList } from "@opencode-ai/ui/hooks" |
2 | 2 | import { useSpring } from "@opencode-ai/ui/motion-spring" |
3 | | -import { createEffect, on, Component, Show, onCleanup, Switch, Match, createMemo, createSignal } from "solid-js" |
| 3 | +import { createEffect, on, Component, Show, onCleanup, createMemo, createSignal } from "solid-js" |
4 | 4 | import { createStore } from "solid-js/store" |
5 | 5 | import { useLocal } from "@/context/local" |
6 | 6 | import { selectionFromLines, type SelectedLineRange, useFile } from "@/context/file" |
@@ -244,6 +244,23 @@ export const PromptInput: Component<PromptInputProps> = (props) => { |
244 | 244 | }, |
245 | 245 | ) |
246 | 246 | const working = createMemo(() => status()?.type !== "idle") |
| 247 | + const tip = () => { |
| 248 | + if (working()) { |
| 249 | + return ( |
| 250 | + <div class="flex items-center gap-2"> |
| 251 | + <span>{language.t("prompt.action.stop")}</span> |
| 252 | + <span class="text-icon-base text-12-medium text-[10px]!">{language.t("common.key.esc")}</span> |
| 253 | + </div> |
| 254 | + ) |
| 255 | + } |
| 256 | + |
| 257 | + return ( |
| 258 | + <div class="flex items-center gap-2"> |
| 259 | + <span>{language.t("prompt.action.send")}</span> |
| 260 | + <Icon name="enter" size="small" class="text-icon-base" /> |
| 261 | + </div> |
| 262 | + ) |
| 263 | + } |
247 | 264 | const imageAttachments = createMemo(() => |
248 | 265 | prompt.current().filter((part): part is ImageAttachmentPart => part.type === "image"), |
249 | 266 | ) |
@@ -1365,22 +1382,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => { |
1365 | 1382 | <Tooltip |
1366 | 1383 | placement="top" |
1367 | 1384 | inactive={!prompt.dirty() && !working()} |
1368 | | - value={ |
1369 | | - <Switch> |
1370 | | - <Match when={working()}> |
1371 | | - <div class="flex items-center gap-2"> |
1372 | | - <span>{language.t("prompt.action.stop")}</span> |
1373 | | - <span class="text-icon-base text-12-medium text-[10px]!">{language.t("common.key.esc")}</span> |
1374 | | - </div> |
1375 | | - </Match> |
1376 | | - <Match when={true}> |
1377 | | - <div class="flex items-center gap-2"> |
1378 | | - <span>{language.t("prompt.action.send")}</span> |
1379 | | - <Icon name="enter" size="small" class="text-icon-base" /> |
1380 | | - </div> |
1381 | | - </Match> |
1382 | | - </Switch> |
1383 | | - } |
| 1385 | + value={tip()} |
1384 | 1386 | > |
1385 | 1387 | <IconButton |
1386 | 1388 | data-action="prompt-submit" |
|
0 commit comments