diff --git a/src/client/Elements/Radio.jsx b/src/client/Elements/Radio.jsx new file mode 100644 index 0000000..b60013f --- /dev/null +++ b/src/client/Elements/Radio.jsx @@ -0,0 +1,31 @@ +import { Radio as AntRadio } from 'antd'; +import { useOptions } from 'client/hooks/useOptions'; +import { useStatus } from 'client/hooks/useStatus'; +import { useStoreValue } from 'client/hooks/useStoreValue'; +import { Status } from 'core/types/elements'; +import { observer } from 'mobx-react'; +import React from 'react'; + +const Radio = ({ name, buttonStyle, computedValue, valueName }) => { + const { value, setCurrentValue } = useStoreValue({ + computedValue, + valueName, + }); + const { status } = useStatus(name); + const { options } = useOptions(name); + + return ( + setCurrentValue(e.target.value)} + > + {options.map((option, i) => ( + {option.name} + ))} + + ); +}; + +export default observer(Radio);