|
@@ -4,19 +4,12 @@ import { useSync } from "@tui/context/sync"
|
|
|
import { map, pipe, flatMap, entries, filter, isDeepEqual, sortBy } from "remeda"
|
|
import { map, pipe, flatMap, entries, filter, isDeepEqual, sortBy } from "remeda"
|
|
|
import { DialogSelect, type DialogSelectRef } from "@tui/ui/dialog-select"
|
|
import { DialogSelect, type DialogSelectRef } from "@tui/ui/dialog-select"
|
|
|
import { useDialog } from "@tui/ui/dialog"
|
|
import { useDialog } from "@tui/ui/dialog"
|
|
|
-import { useTheme } from "../context/theme"
|
|
|
|
|
-
|
|
|
|
|
-function Free() {
|
|
|
|
|
- const { theme } = useTheme()
|
|
|
|
|
- return <span style={{ fg: theme.secondary }}>Free</span>
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
export function DialogModel() {
|
|
export function DialogModel() {
|
|
|
const local = useLocal()
|
|
const local = useLocal()
|
|
|
const sync = useSync()
|
|
const sync = useSync()
|
|
|
const dialog = useDialog()
|
|
const dialog = useDialog()
|
|
|
const [ref, setRef] = createSignal<DialogSelectRef<unknown>>()
|
|
const [ref, setRef] = createSignal<DialogSelectRef<unknown>>()
|
|
|
- const { theme } = useTheme()
|
|
|
|
|
|
|
|
|
|
const options = createMemo(() => {
|
|
const options = createMemo(() => {
|
|
|
return [
|
|
return [
|
|
@@ -36,7 +29,6 @@ export function DialogModel() {
|
|
|
title: model.name ?? item.modelID,
|
|
title: model.name ?? item.modelID,
|
|
|
description: provider.name,
|
|
description: provider.name,
|
|
|
category: "Recent",
|
|
category: "Recent",
|
|
|
- footer: model.cost.input === 0 && provider.id === "opencode" ? <Free /> : undefined,
|
|
|
|
|
},
|
|
},
|
|
|
]
|
|
]
|
|
|
})
|
|
})
|
|
@@ -59,7 +51,6 @@ export function DialogModel() {
|
|
|
title: info.name ?? model,
|
|
title: info.name ?? model,
|
|
|
description: provider.name,
|
|
description: provider.name,
|
|
|
category: provider.name,
|
|
category: provider.name,
|
|
|
- footer: info.cost.input === 0 && provider.id === "opencode" ? <Free /> : undefined,
|
|
|
|
|
})),
|
|
})),
|
|
|
filter((x) => Boolean(ref()?.filter) || !local.model.recent().find((y) => isDeepEqual(y, x.value))),
|
|
filter((x) => Boolean(ref()?.filter) || !local.model.recent().find((y) => isDeepEqual(y, x.value))),
|
|
|
),
|
|
),
|