shell: add Field component (used by modal-new-recorder, was missing from global scope)
This commit is contained in:
parent
bec58ab138
commit
81324c8e52
1 changed files with 20 additions and 0 deletions
|
|
@ -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.Sidebar = Sidebar;
|
||||||
window.Topbar = Topbar;
|
window.Topbar = Topbar;
|
||||||
window.NAV_TREE = NAV_TREE;
|
window.NAV_TREE = NAV_TREE;
|
||||||
|
window.Field = Field;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue