import { cloneElement, isValidElement, useId, type ReactElement, type ReactNode, } from "react"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import FormControlLabel from "@mui/material/FormControlLabel"; import Switch from "@mui/material/Switch"; /** Labeled field wrapper: label (+required) + the input + an error/hint line. */ export function Field({ label, required, error, hint, children, }: { label: string; required?: boolean; error?: string; hint?: string; children: ReactNode; }) { // Associate the