+
+
+ {creating ? (
+
+
{
+ setNewName(e.target.value);
+ if (error) setError(null);
+ }}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter') commitCreate();
+ if (e.key === 'Escape') cancelCreate();
+ }}
+ />
+
+
+
+
+
+ ) : (
+
+
+ {boundVariable && (
+
+ )}
+
+ )}
+
+ {error && (
+
{error}
+ )}
+
+ {boundVariable && !creating && (
+
+
+ {boundVariable.defaultValue === ''
+ ? tv.emptyDefault
+ : `"${boundVariable.defaultValue}"`}
+ {' '}
+ {tv.boundHint}
+
+ )}
+
+ );
+}
+
+/** Render `{name}: "{default}"`, truncating long defaults so the
+ *