@shutootaki/gwm
Version:
git worktree manager CLI
28 lines • 1.24 kB
JavaScript
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
import { useState } from 'react';
import { Text, Box } from 'ink';
import { SelectList } from './SelectList.js';
const testItems = [
{
label: 'feature/user-authentication',
value: 'feature/user-authentication',
},
{ label: 'fix/login-bug', value: 'fix/login-bug' },
{ label: 'feature/api-cache', value: 'feature/api-cache' },
{ label: 'hotfix/security-patch', value: 'hotfix/security-patch' },
{ label: 'feature/new-ui', value: 'feature/new-ui' },
{ label: 'develop', value: 'develop' },
{ label: 'staging', value: 'staging' },
];
export const SelectTest = () => {
const [selected, setSelected] = useState(null);
const [cancelled, setCancelled] = useState(false);
if (selected) {
return (_jsx(Box, { children: _jsxs(Text, { color: "green", children: ["Selected: ", selected.label] }) }));
}
if (cancelled) {
return (_jsx(Box, { children: _jsx(Text, { color: "red", children: "Cancelled" }) }));
}
return (_jsx(SelectList, { items: testItems, onSelect: setSelected, onCancel: () => setCancelled(true), placeholder: "Select a branch:" }));
};
//# sourceMappingURL=SelectTest.js.map