diff --git a/ui/src/components/UI/Radio.tsx b/ui/src/components/UI/Radio.tsx new file mode 100644 index 000000000..23a71e1d9 --- /dev/null +++ b/ui/src/components/UI/Radio.tsx @@ -0,0 +1,17 @@ +import React from "react"; + +export interface Props { + checked: boolean; + onToggle: (checked:boolean) => any; +} + +const Radio: React.FC = ({checked, onToggle}) => { + + return ( +
+ onToggle(event.target.checked)}/> +
+ ); +}; + +export default Radio; diff --git a/ui/src/components/UI/SelectList.tsx b/ui/src/components/UI/SelectList.tsx index 0659de6b2..6acd376c1 100644 --- a/ui/src/components/UI/SelectList.tsx +++ b/ui/src/components/UI/SelectList.tsx @@ -1,5 +1,6 @@ import { useMemo, useState } from "react"; import Checkbox from "./Checkbox" +import Radio from "./Radio"; export interface Props { valuesListInput; @@ -73,10 +74,11 @@ const SelectList: React.FC = ({valuesListInput,tableName,multiSelect=true {filteredValues?.map(listValue => { return - toggleValues(listValue)}/> + {multiSelect && toggleValues(listValue)}/>} + {!multiSelect && toggleValues(listValue)}/>} {listValue} - + } )}