+
setDraft(e.target.value)}
+ onBlur={() => void submit()}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") {
+ e.preventDefault();
+ void submit();
+ } else if (e.key === "Escape") {
+ e.preventDefault();
+ submittedRef.current = true;
+ exitEdit();
+ }
+ }}
+ className="-mx-2 block w-full rounded-md bg-panel-alt px-2 py-0.5 text-xl font-semibold text-fg outline-1 -outline-offset-1 outline-line-strong focus:outline-2 focus:-outline-offset-1 focus:outline-teal-500 disabled:opacity-60"
+ />
+
+
+ {isSaving ? "Saving…" : "Press Enter to save · Esc to cancel"}
+
+ {showCount && !isSaving && (
+
+ {remaining} left
+
+ )}
+
+
+ );
+ }
+
+ return (
+