import type { ReactNode } from "react"; import Tooltip from "../Tooltip"; // Shared form/settings primitives, factored out of the many panels that each re-declared // them (Settings, Config, Stats, admin pages, Setup wizard). Visual contract unchanged. /** Pill on/off switch — the bare control; compose it with your own label/row. */ export function Switch({ checked, onChange, }: { checked: boolean; onChange: (v: boolean) => void; }) { return ( ); } /** A titled settings block. Default = a plain block with an uppercase caption; `card` wraps it * in a glass card (the admin pages' style). */ export function Section({ title, card, children, }: { title: string; card?: boolean; children: ReactNode; }) { return (
{title}
{children}
); } /** A label that reveals an explanatory caption on hover (dotted underline) when `hint` is set. * No-op styling when there's no hint, so it's safe to use unconditionally. */ export function HintLabel({ hint, children }: { hint?: string; children: ReactNode }) { return ( {children} ); } /** A settings row: a (hint-able) label on the left, a control on the right. */ export function SettingRow({ label, hint, children, }: { label: string; hint?: string; children: ReactNode; }) { return (
{label} {children}
); }