{"size": 677, "ext": "js", "max_stars_repo_path": "components/src/controls/LabeledRadioGroup.js", "max_stars_repo_name": "faliester/opentrons", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "components/src/controls/LabeledRadioGroup.js", "max_issues_repo_name": "faliester/opentrons", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "components/src/controls/LabeledRadioGroup.js", "max_forks_repo_name": "faliester/opentrons", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.5666666667, "max_line_length": 78, "alphanum_fraction": 0.6735598227}
// @flow
import * as React from 'react'

import { StackedLabeledControl } from './StackedLabeledControl'
import { RadioGroup } from '../forms'

import type { RadioGroupProps } from '../forms'

export type LabeledRadioGroupProps = {|
  ...RadioGroupProps,
  label: string,
  children: React.Node,
  'data-test'?: string,
|}

export function LabeledRadioGroup(props: LabeledRadioGroupProps): React.Node {
  const { label, value, options, onChange } = props

  return (
    <StackedLabeledControl
      label={label}
      control={
        <RadioGroup value={value} options={options} onChange={onChange} />
      }
    >
      {props.children}
    </StackedLabeledControl>
  )
}
