Initial commit

Signed-off-by: Ilan Bigio <ilan@openai.com>
This commit is contained in:
Ilan Bigio
2025-04-16 12:56:08 -04:00
commit 59a180ddec
163 changed files with 30587 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import { useInput } from "ink";
export const useSelect = ({ isDisabled = false, state }) => {
useInput(
(_input, key) => {
if (key.downArrow) {
state.focusNextOption();
}
if (key.upArrow) {
state.focusPreviousOption();
}
if (key.return) {
state.selectFocusedOption();
}
},
{ isActive: !isDisabled },
);
};