feat: add tui ui kit
This commit is contained in:
26
src/tui/components/selectors.ts
Normal file
26
src/tui/components/selectors.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import {
|
||||
SelectList,
|
||||
type SelectItem,
|
||||
SettingsList,
|
||||
type SettingItem,
|
||||
} from "@mariozechner/pi-tui";
|
||||
import { selectListTheme, settingsListTheme } from "../theme/theme.js";
|
||||
|
||||
export function createSelectList(items: SelectItem[], maxVisible = 7) {
|
||||
return new SelectList(items, maxVisible, selectListTheme);
|
||||
}
|
||||
|
||||
export function createSettingsList(
|
||||
items: SettingItem[],
|
||||
onChange: (id: string, value: string) => void,
|
||||
onCancel: () => void,
|
||||
maxVisible = 7,
|
||||
) {
|
||||
return new SettingsList(
|
||||
items,
|
||||
maxVisible,
|
||||
settingsListTheme,
|
||||
onChange,
|
||||
onCancel,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user