"use client"; import { Fragment, type ReactNode } from "react"; import { UNIT_SYSTEMS, unitLabel, unitWord, type EntryDimension, type UnitSystem, } from "@/lib/units"; import { cn } from "@/lib/utils"; export interface EntryUnitToggleProps { /** Which measurement this governs, which is what decides the two labels. */ dimension: EntryDimension; /** The system currently on, highlighted between the two. */ entryUnits: UnitSystem; /** Flips to the other system. */ onToggle: () => void; } /** * A two-segment switch for one dimension's *entry* units - "m | ft", "bar | psi". * * One ` ); } /** * A field's label row with its unit toggle parked at the right-hand end. * * The toggle is positioned rather than laid out beside the label, and that is the * whole point of this component: **any flex or grid parent blockifies its * children**, and `FormLabel` is a `