import React from 'react'; import { StyleSheet, View } from 'react-native'; import ConfiguratorChoice from './ConfiguratorChoice'; import { FunctionArgument, FunctionParameter, OnArgumentChangeCallback, PrimitiveArgument, } from './index.types'; type Props = { parameters: FunctionParameter[]; value: FunctionArgument[]; onChange: OnArgumentChangeCallback; }; export default function Configurator({ parameters, value, onChange }: Props) { return ( {parameters.map((parameter, index) => parameter.type === 'constant' ? null : parameter.type === 'object' ? ( parameter.properties.map(({ name, ...properties }) => ( )[name]} onChange={onChange} /> )) ) : ( ) )} ); } const styles = StyleSheet.create({ container: { marginVertical: 5, }, });