/** * External dependencies */ import classnames from 'classnames'; import { withInstanceId } from '@wordpress/compose'; /** * Internal dependencies */ import RadioControlOption from './option'; import './style.scss'; const RadioControl = ( { className, instanceId, id, selected, onChange, options = [], } ) => { const radioControlId = id || instanceId; return ( options.length && (
{ options.map( ( option ) => ( { onChange( value ); if ( typeof option.onChange === 'function' ) { option.onChange( value ); } } } /> ) ) }
) ); }; export default withInstanceId( RadioControl ); export { RadioControlOption }; export { default as RadioControlOptionLayout } from './option-layout';