From f98f5b44c329cf86ebe76335844c226f6c90c960 Mon Sep 17 00:00:00 2001 From: Randall Stillwell Date: Wed, 3 Jun 2026 16:54:36 -0500 Subject: [PATCH] Extract collection edit and delete modals (Brief 2). Adds CollectionEditModal and CollectionDeleteModal for the collection detail page. Co-authored-by: Cursor --- components/CollectionDeleteModal.js | 46 +++++++++ components/CollectionEditModal.js | 110 ++++++++++++++++++++++ pages/collection/[identifier].js | 140 +++------------------------- 3 files changed, 171 insertions(+), 125 deletions(-) create mode 100644 components/CollectionDeleteModal.js create mode 100644 components/CollectionEditModal.js diff --git a/components/CollectionDeleteModal.js b/components/CollectionDeleteModal.js new file mode 100644 index 0000000..8cf9464 --- /dev/null +++ b/components/CollectionDeleteModal.js @@ -0,0 +1,46 @@ +import { collectionDisplayName } from '../lib/collection-vocabulary.js'; + +export default function CollectionDeleteModal({ + isOpen, + collection, + onClose, + onConfirm, +}) { + if (!isOpen || !collection) { + return null; + } + + return ( +
+
+

+ Delete List +

+

+ Are you sure you want to delete "{collectionDisplayName(collection)}"? This action + cannot be undone and will permanently remove all cards and data associated with this list. +

+
+ + +
+
+
+ ); +} diff --git a/components/CollectionEditModal.js b/components/CollectionEditModal.js new file mode 100644 index 0000000..425961e --- /dev/null +++ b/components/CollectionEditModal.js @@ -0,0 +1,110 @@ +export default function CollectionEditModal({ + isOpen, + editForm, + setEditForm, + onClose, + onSave, +}) { + if (!isOpen) { + return null; + } + + return ( +
+
+

+ Edit List +

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