Can configure network NAT settings from UI
This commit is contained in:
40
virtweb_frontend/src/widgets/forms/RadioGroupInput.tsx
Normal file
40
virtweb_frontend/src/widgets/forms/RadioGroupInput.tsx
Normal file
@ -0,0 +1,40 @@
|
||||
import {
|
||||
RadioGroup,
|
||||
FormControlLabel,
|
||||
Radio,
|
||||
FormControl,
|
||||
FormLabel,
|
||||
} from "@mui/material";
|
||||
|
||||
interface RadioGroupOption {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export function RadioGroupInput(p: {
|
||||
editable: boolean;
|
||||
label?: string;
|
||||
options: RadioGroupOption[];
|
||||
value: string;
|
||||
onValueChange: (v: string) => void;
|
||||
}): React.ReactElement {
|
||||
return (
|
||||
<FormControl>
|
||||
{p.label && <FormLabel>{p.label}</FormLabel>}
|
||||
<RadioGroup
|
||||
row
|
||||
value={p.value}
|
||||
onChange={(_ev, v) => p.onValueChange?.(v)}
|
||||
>
|
||||
{p.options.map((o) => (
|
||||
<FormControlLabel
|
||||
disabled={!p.editable}
|
||||
value={o.value}
|
||||
control={<Radio />}
|
||||
label={o.label}
|
||||
/>
|
||||
))}
|
||||
</RadioGroup>
|
||||
</FormControl>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user