From 41814aa14040aa038c17ee0728532b0e341c5953 Mon Sep 17 00:00:00 2001 From: sowgro Date: Tue, 31 Dec 2024 00:49:03 -0500 Subject: Refactor BMIcon --- extension/src/components/RadioButtonGroup.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'extension/src/components/RadioButtonGroup.tsx') diff --git a/extension/src/components/RadioButtonGroup.tsx b/extension/src/components/RadioButtonGroup.tsx index 297800d..ff5835d 100644 --- a/extension/src/components/RadioButtonGroup.tsx +++ b/extension/src/components/RadioButtonGroup.tsx @@ -1,4 +1,8 @@ import React, {ReactElement, useEffect, useId, useState} from "react"; +// +// function RadioEntry(props: {value: any, children: ReactElement}) { +// return props.children +// } /** * A component for a group of radio buttons where only one can be selected @@ -7,7 +11,7 @@ import React, {ReactElement, useEffect, useId, useState} from "react"; * @param props.value The option which is selected * @param props.onChange A function that will be called when the selected option changes */ -function RadioButtonGroup(props: { children: ReactElement[], value: any, onChange?: (arg0: any) => void }) { +function RadioButtonGroup(props: { children: {props: {value: any, children: ReactElement}}[], value: any, onChange?: (arg0: any) => void }) { const [selected, setSelected] = useState(props.value); useEffect(() => { setSelected(props.value); @@ -18,7 +22,7 @@ function RadioButtonGroup(props: { children: ReactElement[], return (
- { props.children.map((item) => ( + { props.children && props.children.map((item) => (