import {Fragment} from '@wordpress/element'; import svgIcons from '../../../../assets/svg/svgs.json'; const AstRadioImageControl = props => { const { label, description, id, choices, metavalue } = props; const onLayoutChange = (value) => { props.onChange( value ); }; let htmlLabel = null, htmlDescription = null, htmlRadio; const counterClass = Object.keys( choices ).length ? 'ast-radio-option-' + Object.keys( choices ).length :''; if (label) { htmlLabel = {label}; } if (description) { htmlDescription = {description}; } htmlRadio = Object.entries(choices).map(([key, data]) => { let value = data.value; let checked = metavalue === value ? true : false; return ( onLayoutChange(value)}/> ); }); return
{ ( htmlLabel || htmlDescription ) && }
{htmlRadio}
; }; export default AstRadioImageControl;