diff --git a/src/client/src/modules/draft/DeckBuilderView.tsx b/src/client/src/modules/draft/DeckBuilderView.tsx index 6607c30..eb54b19 100644 --- a/src/client/src/modules/draft/DeckBuilderView.tsx +++ b/src/client/src/modules/draft/DeckBuilderView.tsx @@ -15,6 +15,54 @@ interface DeckBuilderViewProps { availableBasicLands?: any[]; } +const ManaCurve = ({ deck }: { deck: any[] }) => { + const counts = new Array(8).fill(0); + let max = 0; + + deck.forEach(c => { + // @ts-ignore + const tLine = c.typeLine || c.type_line || ''; + if (tLine.includes('Land')) return; + + // @ts-ignore + let cmc = Math.floor(c.cmc || 0); + if (cmc >= 7) cmc = 7; + counts[cmc]++; + if (counts[cmc] > max) max = counts[cmc]; + }); + + const displayMax = Math.max(max, 4); // Scale based on max, min height 4 for relative scale + + return ( +
+ {counts.map((count, i) => { + const hPct = (count / displayMax) * 100; + return ( +
+ {/* Tooltip */} + {count > 0 &&
+ {count} cards +
} + + {/* Bar Track & Bar */} +
+
0 ? 'bg-indigo-500 group-hover:bg-indigo-400' : 'h-px bg-slate-700'}`} + style={{ height: count > 0 ? `${hPct}%` : '1px' }} + /> +
+ + {/* Axis Label */} + + {i === 7 ? '7+' : i} + +
+ ); + })} +
+ ); +}; + // Internal Helper to normalize card data for visuals const normalizeCard = (c: any): DraftCard => { const targetId = c.scryfallId || c.id; @@ -866,6 +914,12 @@ export const DeckBuilderView: React.FC = ({ initialPool, a
+ {/* Mana Curve at Bottom */} +
+
Mana Curve
+ +
+ {/* Resize Handle */}
= ({ initialPool, a {/* Deck Column */} -
+
Library ({deck.length})
@@ -950,7 +1004,7 @@ export const DeckBuilderView: React.FC = ({ initialPool, a id="deck-zone" className="flex-1 flex flex-col min-h-0 overflow-hidden" > -
+
Library ({deck.length})