shell: add Field component (used by modal-new-recorder, was missing from global scope)

This commit is contained in:
Zac Gaetano 2026-05-22 12:56:33 -04:00
parent bec58ab138
commit 81324c8e52

View file

@ -162,6 +162,26 @@ function Topbar({ crumbs, onNavigate, right }) {
);
}
// General-purpose read-only form field used by recorder modal and other forms.
// Renders as a labeled select (when select=true) or text input.
function Field({ label, value, select, children }) {
return (
<div className="field">
<label className="field-label">{label}</label>
{children || (select
? (
<select className="field-input" defaultValue={value} style={{ appearance: 'auto' }}>
<option value={value}>{value}</option>
</select>
) : (
<input className="field-input" defaultValue={value} readOnly />
)
)}
</div>
);
}
window.Sidebar = Sidebar;
window.Topbar = Topbar;
window.NAV_TREE = NAV_TREE;
window.Field = Field;