-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
/
Copy pathStepAuthProvider.tsx
39 lines (36 loc) · 1.06 KB
/
StepAuthProvider.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
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 SupportedAuthProviders: ChoiceType[] = [
{
label: 'Hard coded local username/password',
value: 'local-auth-provider',
description: 'Hard coded local username/password',
},
{ label: 'None', value: 'none', description: 'No authProvider' },
];
export const StepAuthProvider = ({
onSubmit,
}: {
onSubmit: (value: string) => void;
}) => {
const handleSelect = (item: ChoiceType) => {
onSubmit(item.value);
};
return (
<Stack>
<Text>
Select the auth provider you want to use, and validate with
Enter:
</Text>
<SelectInput
items={SupportedAuthProviders}
itemComponent={SelectInputChoice}
onSelect={handleSelect}
initialIndex={0}
/>
</Stack>
);
};