refactor: replace until loop with map

This commit is contained in:
André Sá 2022-03-08 17:31:44 +00:00
parent 93873306a9
commit 2e3e050c54

View file

@ -46,24 +46,18 @@ const Wizard = ({ machine, locale, onClose, save, error }) => {
}) })
} }
const steps = [] const steps = R.map(
it => ({
R.until( type: `cassette${it}`,
R.gt(R.__, machine.numberOfCassettes), display: `Cassette ${it}`,
it => { component: Autocomplete,
steps.push({ inputProps: {
type: `cassette${it}`, options: R.map(it => ({ code: it, display: it }), options),
display: `Cassette ${it}`, labelProp: 'display',
component: Autocomplete, valueProp: 'code'
inputProps: { }
options: R.map(it => ({ code: it, display: it }))(options), }),
labelProp: 'display', R.range(1, machine.numberOfCassettes + 1)
valueProp: 'code'
}
})
return R.add(1, it)
},
1
) )
const schema = () => const schema = () =>