From 2a03a0ff4f5e101d7a61a0b66274cbb838a23f99 Mon Sep 17 00:00:00 2001 From: Randall Stillwell Date: Sat, 13 Jun 2026 00:45:50 -0500 Subject: [PATCH] refactor(decks): extract edit modal and deck grid (Brief 2) Move the deck list grid (empty state + cards) into DecksGrid and the edit form into DecksEditModal to continue shrinking pages/decks.js. Co-authored-by: Cursor --- components/DecksEditModal.js | 80 ++++++++++++++++ components/DecksGrid.js | 98 +++++++++++++++++++ pages/decks.js | 180 +++-------------------------------- 3 files changed, 192 insertions(+), 166 deletions(-) create mode 100644 components/DecksEditModal.js create mode 100644 components/DecksGrid.js diff --git a/components/DecksEditModal.js b/components/DecksEditModal.js new file mode 100644 index 0000000..eed667b --- /dev/null +++ b/components/DecksEditModal.js @@ -0,0 +1,80 @@ +import { Modal, Input, Button } from './ui'; +import { DECK_INPUT_FIELD_CLASS } from '../lib/deck-format-utils.js'; + +export default function DecksEditModal({ + editingDeck, + setEditingDeck, + onClose, + onEdit, +}) { + return ( + + {editingDeck && ( +
+ setEditingDeck({ ...editingDeck, name: e.target.value })} + /> +
+ + +
+
+ +