Download packages/tui/src/component/dialog-variant.tsx from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 896 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/component/dialog-variant.tsx
- Command line
-
hf download hf://SaylorTwift/opencode/packages/tui/src/component/dialog-variant.tsx
-
curl -L -o dialog-variant.tsx https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/component/dialog-variant.tsx
896 Bytes
| import { createMemo } from "solid-js" | |
| import { useLocal } from "../context/local" | |
| import { DialogSelect } from "../ui/dialog-select" | |
| import { useDialog } from "../ui/dialog" | |
| export function DialogVariant() { | |
| const local = useLocal() | |
| const dialog = useDialog() | |
| const options = createMemo(() => { | |
| return [ | |
| { | |
| value: "default", | |
| title: "Default", | |
| onSelect: () => { | |
| dialog.clear() | |
| local.model.variant.set(undefined) | |
| }, | |
| }, | |
| ...local.model.variant.list().map((variant) => ({ | |
| value: variant, | |
| title: variant, | |
| onSelect: () => { | |
| dialog.clear() | |
| local.model.variant.set(variant) | |
| }, | |
| })), | |
| ] | |
| }) | |
| return ( | |
| <DialogSelect<string> | |
| options={options()} | |
| title={"Select variant"} | |
| current={local.model.variant.selected()} | |
| flat={true} | |
| /> | |
| ) | |
| } | |