"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RadioGroup = void 0;
const react_1 = __importDefault(require("react"));
const Radio_1 = require("./Radio");
const get = (obj, property) => (typeof obj === "object" ? obj[property] : obj);
const RadioGroup = ({ radioArr, layout, name, selected, setSelected, }) => {
    return (react_1.default.createElement("div", { className: "on-radio-wrapper" + " " + layout }, radioArr.map((item, index) => (react_1.default.createElement(Radio_1.Radio, { key: index, name: name, value: get(item, "value"), label: get(item, "label"), checked: selected === get(item, "value"), onChange: (e) => setSelected(e.target.value) })))));
};
exports.RadioGroup = RadioGroup;
