mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 00:09:40 +02:00
feat(edge/templates): introduce edge specific settings [EE-6276] (#10609)
This commit is contained in:
parent
68950fbb24
commit
e43d076269
42 changed files with 885 additions and 319 deletions
36
app/react/components/RadioGroup/RadioGroup.tsx
Normal file
36
app/react/components/RadioGroup/RadioGroup.tsx
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { Option } from '@@/form-components/PortainerSelect';
|
||||
|
||||
interface Props<T extends string | number> {
|
||||
options: Array<Option<T>> | ReadonlyArray<Option<T>>;
|
||||
selectedOption: T;
|
||||
name: string;
|
||||
onOptionChange: (value: T) => void;
|
||||
}
|
||||
|
||||
export function RadioGroup<T extends string | number = string>({
|
||||
options,
|
||||
selectedOption,
|
||||
name,
|
||||
onOptionChange,
|
||||
}: Props<T>) {
|
||||
return (
|
||||
<div>
|
||||
{options.map((option) => (
|
||||
<span
|
||||
key={option.value}
|
||||
className="col-sm-3 col-lg-2 control-label !p-0 text-left"
|
||||
>
|
||||
<input
|
||||
type="radio"
|
||||
name={name}
|
||||
value={option.value}
|
||||
checked={selectedOption === option.value}
|
||||
onChange={() => onOptionChange(option.value)}
|
||||
style={{ margin: '0 4px 0 0' }}
|
||||
/>
|
||||
{option.label}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue