import React, { useState } from 'react' import { Stepper } from 'app/components' type State = { selectedOnePoint: string[] selectedTwoPoints: string[] selectFourPoints: string[] } const stepIDsMap = { first: 'first', second: 'second', third: 'third', fourth: 'fourth', fifth: 'fifth' } as const const Demo = () => { const [ state, setState ] = useState({ selectedOnePoint: [ stepIDsMap.second ], selectedTwoPoints: [ stepIDsMap.first, stepIDsMap.third ], selectFourPoints: [ stepIDsMap.first, stepIDsMap.second, stepIDsMap.third, stepIDsMap.fourth ] }) const { selectedOnePoint, selectedTwoPoints, selectFourPoints } = state return <>

{ const [ selected ] = values state.selectedOnePoint = [ selected.value ] setState({ ...state }) } } />

{ const [ selected ] = values state.selectedOnePoint = [ selected.value ] setState({ ...state }) } } />

{ const [ from, to ] = values state.selectedTwoPoints = [ from.value, to.value ] setState({ ...state }) } } />

{ const [ from_1, to_1, from_2, to_2 ] = values state.selectFourPoints = [ from_1.value, to_1.value, from_2.value, to_2.value ] setState({ ...state }) } } /> } Demo.coreSrcDirName = 'Stepper' export default Demo