-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
/
Copy pathStepInstall.tsx
41 lines (39 loc) · 979 Bytes
/
StepInstall.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import * as React from 'react';
import { Text } from 'ink';
import SelectInput from 'ink-select-input';
import { ChoiceType, SelectInputChoice } from './SelectInputChoice';
import { Stack } from './Stack';
const choices: ChoiceType[] = [
{
label: 'Using npm',
value: 'npm',
},
{
label: 'Using yarn',
value: 'yarn',
},
{
label: "Don't install dependencies, I'll do it myself.",
value: '',
},
];
export const StepInstall = ({
onSubmit,
}: {
onSubmit: (value: string) => void;
}) => {
const handleSelect = (item: ChoiceType) => {
onSubmit(item.value);
};
return (
<Stack>
<Text>How do you want to install the dependencies?</Text>
<SelectInput<string>
items={choices}
itemComponent={SelectInputChoice}
onSelect={handleSelect}
initialIndex={0}
/>
</Stack>
);
};