11import { 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'
44import MultiSelect from '../Multiselect/index.js'
55
6- interface Props {
7- installation : InstallationType | undefined
8- onCompletion : ( ) => void
9- onSubmit : ( selectedItems : Array < MultiSelectItem > ) => void
10- }
11-
126const customPackages : Array < MultiSelectItem > = [
137 {
148 label : 'Component Demos' ,
@@ -32,23 +26,26 @@ const customPackages: Array<MultiSelectItem> = [
3226 } ,
3327]
3428
29+ interface Props {
30+ onCompletion : ( ) => void
31+ onSubmit : ( selectedItems : Array < MultiSelectItem > ) => void
32+ skip ?: boolean
33+ }
34+
3535/**
3636 * Step for selecting optional packages. Skipped if installation type is 'full'.
3737 * @param onCompletion
3838 * @param onSubmit
3939 * @param installation
40+ * @param skip
4041 */
41- const OptionalPackages : FC < Props > = ( { onCompletion, onSubmit, installation } ) => {
42+ const OptionalPackages : FC < Props > = ( { onCompletion, onSubmit, skip = false } ) => {
4243 const [ isFocused , setIsFocused ] = useState ( true )
43- const skip = installation === 'full'
4444
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+ }
5249
5350 const onHandleSubmit = ( selectedItems : Array < MultiSelectItem > ) => {
5451 onSubmit ( selectedItems )
0 commit comments