1
1
import { Text } from 'ink'
2
- import React , { useState , type FC , useEffect } from 'react'
3
- import type { InstallationType , MultiSelectItem } from '../../types/types.js'
2
+ import { type FC , useState } from 'react'
3
+ import type { MultiSelectItem } from '../../types/types.js'
4
4
import MultiSelect from '../Multiselect/index.js'
5
5
6
- interface Props {
7
- installation : InstallationType | undefined
8
- onCompletion : ( ) => void
9
- onSubmit : ( selectedItems : Array < MultiSelectItem > ) => void
10
- }
11
-
12
6
const customPackages : Array < MultiSelectItem > = [
13
7
{
14
8
label : 'Component Demos' ,
@@ -32,23 +26,26 @@ const customPackages: Array<MultiSelectItem> = [
32
26
} ,
33
27
]
34
28
29
+ interface Props {
30
+ onCompletion : ( ) => void
31
+ onSubmit : ( selectedItems : Array < MultiSelectItem > ) => void
32
+ skip ?: boolean
33
+ }
34
+
35
35
/**
36
36
* Step for selecting optional packages. Skipped if installation type is 'full'.
37
37
* @param onCompletion
38
38
* @param onSubmit
39
39
* @param installation
40
+ * @param skip
40
41
*/
41
- const OptionalPackages : FC < Props > = ( { onCompletion, onSubmit, installation } ) => {
42
+ const OptionalPackages : FC < Props > = ( { onCompletion, onSubmit, skip = false } ) => {
42
43
const [ isFocused , setIsFocused ] = useState ( true )
43
- const skip = installation === 'full'
44
44
45
- // biome-ignore lint/correctness/useExhaustiveDependencies: Run this only once
46
- useEffect ( ( ) => {
47
- // full installation, do nothing
48
- if ( skip ) {
49
- onCompletion ( )
50
- }
51
- } , [ ] )
45
+ // full installation, do nothing
46
+ if ( skip ) {
47
+ onCompletion ( )
48
+ }
52
49
53
50
const onHandleSubmit = ( selectedItems : Array < MultiSelectItem > ) => {
54
51
onSubmit ( selectedItems )
0 commit comments