From f9a8ce695a6fd3e17b19738a5de01031de408e7c Mon Sep 17 00:00:00 2001 From: Randall Stillwell Date: Wed, 3 Jun 2026 12:51:13 -0500 Subject: [PATCH] Extract CollectionsCreateModal and tag helpers (Brief 1). Moves create-list modal UI to components/CollectionsCreateModal.js and tag input helpers to lib/collection-tag-input.js (shared with edit modal). Co-authored-by: Cursor --- components/CollectionsCreateModal.js | 181 +++++++++++++++++++++++ lib/collection-tag-input.js | 29 ++++ pages/collections.js | 208 +++------------------------ 3 files changed, 231 insertions(+), 187 deletions(-) create mode 100644 components/CollectionsCreateModal.js create mode 100644 lib/collection-tag-input.js diff --git a/components/CollectionsCreateModal.js b/components/CollectionsCreateModal.js new file mode 100644 index 0000000..6eeed29 --- /dev/null +++ b/components/CollectionsCreateModal.js @@ -0,0 +1,181 @@ +import { + addCollectionTag, + handleCollectionTagKeyPress, + removeCollectionTag, +} from '../lib/collection-tag-input.js'; + +export default function CollectionsCreateModal({ + isOpen, + newCollection, + setNewCollection, + tagInput, + setTagInput, + onClose, + onCreate, +}) { + if (!isOpen) { + return null; + } + + return ( +
+
+

+ Create New List +

+
+
+ + setNewCollection({ ...newCollection, name: e.target.value })} + placeholder="Enter list name" + /> +
+
+ +