Files
rods/gui-ts/src/ui/common/RadioGroup.tsx
Conner Majic 725a72a773 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
2026-04-16 21:59:42 -06:00

30 lines
815 B
TypeScript

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>
);
}