mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
tui: display 'Free' label for OpenCode models instead of styled component
Simplifies the model selection UI by rendering the free label as plain text rather than a styled span component, reducing unnecessary markup while maintaining clarity about model pricing.
This commit is contained in:
parent
8eedd6aa07
commit
1b121ee702
2 changed files with 4 additions and 5 deletions
|
|
@ -9,7 +9,7 @@ import { createDialogProviderOptions, DialogProvider } from "./dialog-provider"
|
|||
|
||||
function Free() {
|
||||
const { theme } = useTheme()
|
||||
return <span style={{ fg: theme.secondary }}>Free</span>
|
||||
return <span style={{ fg: theme.text }}>Free</span>
|
||||
}
|
||||
const PROVIDER_PRIORITY: Record<string, number> = {
|
||||
opencode: 0,
|
||||
|
|
@ -52,7 +52,7 @@ export function DialogModel() {
|
|||
title: model.name ?? item.modelID,
|
||||
description: provider.name,
|
||||
category: "Recent",
|
||||
footer: model.cost?.input === 0 && provider.id === "opencode" ? <Free /> : undefined,
|
||||
footer: model.cost?.input === 0 && provider.id === "opencode" ? "Free" : undefined,
|
||||
onSelect: () => {
|
||||
dialog.clear()
|
||||
local.model.set(
|
||||
|
|
@ -83,9 +83,9 @@ export function DialogModel() {
|
|||
modelID: model,
|
||||
},
|
||||
title: info.name ?? model,
|
||||
description: provider.name,
|
||||
description: connected() ? provider.name : undefined,
|
||||
category: connected() ? provider.name : undefined,
|
||||
footer: info.cost?.input === 0 && provider.id === "opencode" ? <Free /> : undefined,
|
||||
footer: info.cost?.input === 0 && provider.id === "opencode" ? "Free" : undefined,
|
||||
onSelect() {
|
||||
dialog.clear()
|
||||
local.model.set(
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ export function createDialogProviderOptions() {
|
|||
options={methods.map((x, index) => ({
|
||||
title: x.label,
|
||||
value: index,
|
||||
category: "Method",
|
||||
}))}
|
||||
onSelect={(option) => resolve(option.value)}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue