fed4776451
Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
32 lines
734 B
TypeScript
32 lines
734 B
TypeScript
import { createMemo } from "solid-js"
|
|
import { useLocal } from "@tui/context/local"
|
|
import { DialogSelect } from "@tui/ui/dialog-select"
|
|
import { useDialog } from "@tui/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()
|
|
}}
|
|
/>
|
|
)
|
|
}
|