feat(react): port sort child notes

This commit is contained in:
Elian Doran
2025-08-03 21:18:18 +03:00
parent 164feaa3ec
commit bca397e3e4
13 changed files with 190 additions and 121 deletions

View File

@@ -0,0 +1,30 @@
interface FormRadioProps {
name: string;
currentValue?: string;
values: {
value: string;
label: string;
}[];
onChange(newValue: string): void;
}
export default function FormRadioGroup({ name, values, currentValue, onChange }: FormRadioProps) {
return (
<>
{(values || []).map(({ value, label }) => (
<div className="form-check">
<label className="form-check-label tn-radio">
<input
className="form-check-input"
type="radio"
name={name}
value={value}
checked={value === currentValue}
onChange={e => onChange((e.target as HTMLInputElement).value)} />
{label}
</label>
</div>
))}
</>
);
}