refactor(settings): remove the unused RadioRow control (#4931)

The settings pages that used RadioRow now lay out their radio groups themselves, so it had no callers left and knip failed on main. Removes it with its RadioChoice type.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-21 09:33:05 +08:00
1 джерело a5c8fe17fd
коміт 3e37b60505
1 file changed
+3 -36
+3 -36
Переглянути файл
@@ -1,12 +1,12 @@
/**
* Form pieces of the Version Control / Build, Execution, Deployment / Tools
* pages: bound checkboxes, "[x] Limit … to: [N] unit" rows, radio rows,
* pages: bound checkboxes, "[x] Limit … to: [N] unit" rows,
* two-column grids, string lists and editable two-column tables.
*/
import { useId, useState, type KeyboardEvent, type ReactNode } from "react";
import { useState, type KeyboardEvent, type ReactNode } from "react";
import clsx from "clsx";
import { Checkbox, IconButton, Input } from "@/ui";
import { NumberInput, Row, SearchLabel, Toggle } from "../components/Form";
import { NumberInput, SearchLabel, Toggle } from "../components/Form";
import { useLabelMatch, useSetting } from "../components/context";
import { selectPage } from "../model/staging";
import styles from "./Workflow.module.css";
@@ -89,39 +89,6 @@ export function ToggleNumber({
);
}
export interface RadioChoice<V extends string> {
value: V;
label: string;
}
/** `Label: (•) A ( ) B ( ) C` bound to a key. */
export function RadioRow<V extends string>({
k,
label,
choices,
hint,
}: {
k: string;
label: string;
choices: readonly RadioChoice<V>[];
hint?: ReactNode;
}) {
const [value, set] = useSetting<V>(k);
const name = useId();
return (
<Row label={label} hint={hint}>
<div className={styles.radios} role="radiogroup" aria-label={label}>
{choices.map((c) => (
<label key={c.value} className={styles.radio}>
<input type="radio" name={name} checked={value === c.value} onChange={() => set(c.value)} />
<SearchLabel text={c.label} />
</label>
))}
</div>
</Row>
);
}
/** Link-style button that jumps to another settings page. */
export function PageLink({ page, children }: { page: string; children: ReactNode }) {
return (