Files
openclaw/src/tui/components/selectors.ts
Peter Steinberger 694ca50e97 Revert "refactor: move runtime state to SQLite"
This reverts commit f91de52f0d.
2026-05-13 13:33:38 +01:00

26 lines
954 B
TypeScript

import { type SelectItem, type SettingItem, SettingsList } from "@earendil-works/pi-tui";
import {
filterableSelectListTheme,
searchableSelectListTheme,
settingsListTheme,
} from "../theme/theme.js";
import { FilterableSelectList, type FilterableSelectItem } from "./filterable-select-list.js";
import { SearchableSelectList } from "./searchable-select-list.js";
export function createSearchableSelectList(items: SelectItem[], maxVisible = 7) {
return new SearchableSelectList(items, maxVisible, searchableSelectListTheme);
}
export function createFilterableSelectList(items: FilterableSelectItem[], maxVisible = 7) {
return new FilterableSelectList(items, maxVisible, filterableSelectListTheme);
}
export function createSettingsList(
items: SettingItem[],
onChange: (id: string, value: string) => void,
onCancel: () => void,
maxVisible = 7,
) {
return new SettingsList(items, maxVisible, settingsListTheme, onChange, onCancel);
}