diff --git a/components/CardDetailQuantityModal.js b/components/CardDetailQuantityModal.js
new file mode 100644
index 0000000..263bb48
--- /dev/null
+++ b/components/CardDetailQuantityModal.js
@@ -0,0 +1,81 @@
+import { VOCAB } from '../lib/collection-vocabulary.js';
+
+export default function CardDetailQuantityModal({
+ isOpen,
+ ownedQuantity,
+ quantity,
+ onQuantityChange,
+ onConfirm,
+ onClose,
+}) {
+ if (!isOpen) {
+ return null;
+ }
+
+ return (
+
+
+
+ {ownedQuantity > 0 ? 'Update Quantity' : VOCAB.ADD_TO_MY_COLLECTION}
+
+
+
+
+
+
+ {quantity}
+
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/pages/card/[id].js b/pages/card/[id].js
index 605d4a9..058b0e7 100644
--- a/pages/card/[id].js
+++ b/pages/card/[id].js
@@ -4,6 +4,7 @@ import { useRouter } from 'next/router';
import Layout from '../../components/Layout';
import { useAuth } from '../../lib/use-auth';
import CollectionSelectionModal from '../../components/CollectionSelectionModal';
+import CardDetailQuantityModal from '../../components/CardDetailQuantityModal';
import { ManaCost, ColorIdentity, AdvancedManaCost } from '../../components/ManaSymbols';
import ManaSymbolSettings from '../../components/ManaSymbolSettings';
import { VOCAB, collectionDisplayName } from '../../lib/collection-vocabulary.js';
@@ -763,66 +764,14 @@ export default function CardDetail() {
- {/* Quantity Modal */}
- {showQuantityModal && (
-
-
-
- {ownedQuantity > 0 ? 'Update Quantity' : VOCAB.ADD_TO_MY_COLLECTION}
-
-
-
-
-
-
- {quantity}
-
-
-
-
-
-
-
-
-
-
- )}
+ setShowQuantityModal(false)}
+ />
{/* Collection Selection Modal */}