Initial commit: establish deterministic rod-string solver stack.
Set up the C solver core, Node API orchestration, TS GUI workflow, and engineering documentation with cleaned repo hygiene for private Git hosting. Made-with: Cursor
This commit is contained in:
29
gui-ts/src/ui/common/RadioGroup.tsx
Normal file
29
gui-ts/src/ui/common/RadioGroup.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
export type RadioOption<V extends string> = { value: V; label: string };
|
||||
|
||||
export type RadioGroupProps<V extends string> = {
|
||||
name: string;
|
||||
value: V;
|
||||
onChange: (value: V) => void;
|
||||
options: Array<RadioOption<V>>;
|
||||
disabled?: boolean;
|
||||
};
|
||||
|
||||
export function RadioGroup<V extends string>(props: RadioGroupProps<V>) {
|
||||
return (
|
||||
<div className="panel-radio-group" role="radiogroup">
|
||||
{props.options.map((opt) => (
|
||||
<label key={opt.value} className="panel-radio">
|
||||
<input
|
||||
type="radio"
|
||||
name={props.name}
|
||||
value={opt.value}
|
||||
checked={props.value === opt.value}
|
||||
disabled={props.disabled}
|
||||
onChange={() => props.onChange(opt.value)}
|
||||
/>
|
||||
<span>{opt.label}</span>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user