summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/ui/src')
-rw-r--r--packages/ui/src/components/list.tsx12
1 files changed, 3 insertions, 9 deletions
diff --git a/packages/ui/src/components/list.tsx b/packages/ui/src/components/list.tsx
index 8c92728d7..dc83db53a 100644
--- a/packages/ui/src/components/list.tsx
+++ b/packages/ui/src/components/list.tsx
@@ -10,15 +10,9 @@ export interface ListSearchProps {
autofocus?: boolean
}
-export interface ListGroup<T> {
- category: string
- items: T[]
-}
-
export interface ListProps<T> extends FilteredListProps<T> {
class?: string
children: (item: T) => JSX.Element
- groupHeader?: (group: ListGroup<T>) => JSX.Element
emptyMessage?: string
onKeyEvent?: (event: KeyboardEvent, item: T | undefined) => void
onMove?: (item: T | undefined) => void
@@ -122,7 +116,7 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
setScrollRef,
})
- function GroupHeader(groupProps: { category: string; children?: JSX.Element }): JSX.Element {
+ function GroupHeader(groupProps: { category: string }): JSX.Element {
const [stuck, setStuck] = createSignal(false)
const [header, setHeader] = createSignal<HTMLDivElement | undefined>(undefined)
@@ -144,7 +138,7 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
return (
<div data-slot="list-header" data-stuck={stuck()} ref={setHeader}>
- {groupProps.children ?? groupProps.category}
+ {groupProps.category}
</div>
)
}
@@ -191,7 +185,7 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
{(group) => (
<div data-slot="list-group">
<Show when={group.category}>
- <GroupHeader category={group.category}>{props.groupHeader?.(group)}</GroupHeader>
+ <GroupHeader category={group.category} />
</Show>
<div data-slot="list-items">
<For each={group.items}>