Download packages/tui/src/component/dialog-agent.tsx from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 729 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/component/dialog-agent.tsx
- Command line
-
hf download hf://SaylorTwift/opencode/packages/tui/src/component/dialog-agent.tsx
-
curl -L -o dialog-agent.tsx https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/component/dialog-agent.tsx
729 Bytes
| import { createMemo } from "solid-js" | |
| import { useLocal } from "../context/local" | |
| import { DialogSelect } from "../ui/dialog-select" | |
| import { useDialog } from "../ui/dialog" | |
| export function DialogAgent() { | |
| const local = useLocal() | |
| const dialog = useDialog() | |
| const options = createMemo(() => | |
| local.agent.list().map((item) => { | |
| return { | |
| value: item.name, | |
| title: item.name, | |
| description: item.native ? "native" : item.description, | |
| } | |
| }), | |
| ) | |
| return ( | |
| <DialogSelect | |
| title="Select agent" | |
| current={local.agent.current()?.name} | |
| options={options()} | |
| onSelect={(option) => { | |
| local.agent.set(option.value) | |
| dialog.clear() | |
| }} | |
| /> | |
| ) | |
| } | |