import * as React from "react"; import * as _ from 'lodash'; import * as DefaultStyles from "./style"; import { map } from "lodash"; import { RadioItem } from "../../types/global" export namespace RadioGroup { export interface Props { items: RadioItem[]; selectedId: string | undefined; title: string; onRadioButtonChange: (item: RadioItem) => void; styles?: any; id?: string; name?: string; } export interface State { } export interface Styles { RadioInput: any; RadioLabel: any; RadioWrapper: any; Title: any; } } const RadioGroup = (props: RadioGroup.Props) => { const Styles: RadioGroup.Styles = _.merge(DefaultStyles, props.styles); return ( <> {map(props.items, item => { return ( props.onRadioButtonChange(item)} /> {item.name} ); })} ); }; export default RadioGroup;