diff --git a/components/CardItem.js b/components/CardItem.js index 209fbd1..10b1737 100644 --- a/components/CardItem.js +++ b/components/CardItem.js @@ -1,6 +1,104 @@ import { useState } from 'react'; import { useRouter } from 'next/router'; +// Expanding Add Button Component +function ExpandingAddButton({ card, onAddToCollection, onAddToDeck, onMarkAsOwned }) { + const [isExpanded, setIsExpanded] = useState(false); + + const handleMainClick = (e) => { + e.stopPropagation(); + if (!isExpanded) { + setIsExpanded(true); + } else { + // Default action when expanded - add to collection + onAddToCollection([card]); + setIsExpanded(false); + } + }; + + const handleOptionClick = (e, action) => { + e.stopPropagation(); + action(); + setIsExpanded(false); + }; + + return ( +