Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
ui-component-library / src / forms / __unused / RadioGroup / deps / toRadioInput.tsx
Size: Mime:
const toRadioInput = (input, index) => {
  // I think this was converting it back to props...
  if (input.isInputState === true) {
    return input
  }

  const radioInputProps = {
    // every input in a radiogroup has the same name, that's the specification
    name: input.label || input.name,

    identifier: 'radio_' + index,

    // api data
    isSelected: input.isSelected
      ? input.isSelected
      : input.selected
        ? input.selected
        : false,

    label: input.label || input.name,

    // customizations
    // @todo className
    classes: 'radio-label',

    type: 'radio',
    image: input.image || '',
  }
  return radioInputProps
}

export { toRadioInput }
export default toRadioInput