import React from "react"; import { ArrowRightLeft } from "lucide-react"; import { CHIP_CONFIG, getPlayerPrice } from "../utils/fplLogic"; export const ActiveMovesPanel = ({ activeGW, manualOverrides, globalPlayers, chipsByGw, transfersByGw }) => { const activeLock = manualOverrides[activeGW] || {}; const manualTransfers = activeLock.manualTransfers || {}; const chip = chipsByGw[activeGW]; const tData = transfersByGw[activeGW] || { count: 0, netDelta: 0 }; const moveEntries = Object.entries(manualTransfers); const hasMoves = moveEntries.length > 0; return (
{/* Header */}

GW {activeGW} Moves Made So Far

{chip && CHIP_CONFIG[chip] && ( {CHIP_CONFIG[chip].short} )}
{/* Body */}
{!hasMoves ? (
No active transfers made for GW {activeGW}.
) : ( moveEntries.map(([inIdStr, outPlayer], idx) => { const isBlankIn = inIdStr.startsWith("blank_"); const inPlayer = !isBlankIn ? globalPlayers.find(p => String(p.ID) === inIdStr) : null; return (
{/* Outgoing Player */}
{outPlayer?.Name || "Unknown"} £{(outPlayer ? getPlayerPrice(outPlayer) : 0).toFixed(1)}m
» {/* Incoming Player */}
{isBlankIn ? ( <> Select Player... ) : ( <> {inPlayer?.Name || inIdStr} £{(inPlayer ? getPlayerPrice(inPlayer) : 0).toFixed(1)}m )}
); }) )} {/* Summary Footer */} {hasMoves && (
Total Moves: {tData.count} Bank Delta: = 0 ? 'text-emerald-400' : 'text-red-400'}`}> {tData.netDelta > 0 ? '+' : ''}{tData.netDelta.toFixed(1)}m
)}
); };