/** * Setting row — one named setting laid out as a line: an icon tile, the label * with its one-line description, and the control itself at the end. The * sibling of ToggleRow for controls that aren't switches (a dropdown, a text * box, a slider), so a card mixing both reads as one list of settings rather * than switches in rows and everything else stacked under a heading. * * The control sits beside the text while the card is wide enough for both and * drops under it otherwise — see `.aureon-settingrow` in style.scss, which * decides that against the card's width, not the viewport's. */ import type { ReactNode } from 'react'; import { FormToggle } from '@wordpress/components'; import { useId } from '@wordpress/element'; import type { LucideIcon } from 'lucide-react'; interface SettingRowProps { icon: LucideIcon; label: string; help?: string; /** * `compact` keeps the control beside the text at every width — for a * control narrow enough to always fit there (a switch). */ size?: 'default' | 'compact'; /** Id of the control, so the visible label can point at it. */ htmlFor?: string; children: ReactNode; } export default function SettingRow( { icon: Icon, label, help, size = 'default', htmlFor, children, }: SettingRowProps ) { return (
{ help }
}