summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src
diff options
context:
space:
mode:
authorAdam <[email protected]>2026-02-12 20:19:14 -0600
committerAdam <[email protected]>2026-02-12 20:19:26 -0600
commitfb7b2f6b4d66d14177b5c0168049863842665925 (patch)
tree403262dbfbcd85b44c491a24b5eb06c7ac8125b1 /packages/ui/src
parente0f1c3c20efb60f19f36e2c8df87dfd30fd2523e (diff)
downloadopencode-fb7b2f6b4d66d14177b5c0168049863842665925.tar.gz
opencode-fb7b2f6b4d66d14177b5c0168049863842665925.zip
feat(app): toggle all provider models
Diffstat (limited to 'packages/ui/src')
-rw-r--r--packages/ui/src/components/list.tsx7
-rw-r--r--packages/ui/src/components/switch.tsx2
2 files changed, 5 insertions, 4 deletions
diff --git a/packages/ui/src/components/list.tsx b/packages/ui/src/components/list.tsx
index abd557220..aa2347037 100644
--- a/packages/ui/src/components/list.tsx
+++ b/packages/ui/src/components/list.tsx
@@ -45,6 +45,7 @@ export interface ListProps<T> extends FilteredListProps<T> {
itemWrapper?: (item: T, node: JSX.Element) => JSX.Element
divider?: boolean
add?: ListAddProps
+ groupHeader?: (group: { category: string; items: T[] }) => JSX.Element
}
export interface ListRef {
@@ -206,7 +207,7 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
)
}
- function GroupHeader(groupProps: { category: string }): JSX.Element {
+ function GroupHeader(groupProps: { group: { category: string; items: T[] } }): JSX.Element {
const [stuck, setStuck] = createSignal(false)
const [header, setHeader] = createSignal<HTMLDivElement | undefined>(undefined)
@@ -228,7 +229,7 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
return (
<div data-slot="list-header" data-stuck={stuck()} ref={setHeader}>
- {groupProps.category}
+ {props.groupHeader?.(groupProps.group) ?? groupProps.group.category}
</div>
)
}
@@ -323,7 +324,7 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
return (
<div data-slot="list-group">
<Show when={group.category}>
- <GroupHeader category={group.category} />
+ <GroupHeader group={group} />
</Show>
<div data-slot="list-items">
<For each={group.items}>
diff --git a/packages/ui/src/components/switch.tsx b/packages/ui/src/components/switch.tsx
index a8600aef4..f4f95baf5 100644
--- a/packages/ui/src/components/switch.tsx
+++ b/packages/ui/src/components/switch.tsx
@@ -10,7 +10,7 @@ export interface SwitchProps extends ParentProps<ComponentProps<typeof Kobalte>>
export function Switch(props: SwitchProps) {
const [local, others] = splitProps(props, ["children", "class", "hideLabel", "description"])
return (
- <Kobalte {...others} data-component="switch">
+ <Kobalte {...others} class={local.class} data-component="switch">
<Kobalte.Input data-slot="switch-input" />
<Show when={local.children}>
<Kobalte.Label data-slot="switch-label" classList={{ "sr-only": local.hideLabel }}>