Spaces:
Running
Running
Upload components/TradeHistory.js with huggingface_hub
Browse files12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970import React from 'react';const TradeHistory = ({ trades }) => {if (trades.length === 0) {return (<div className="bg-gray-800 rounded-xl border border-gray-700 overflow-hidden"><div className="p-6 text-center text-gray-400"><i className="fa-solid fa-history text-4xl mb-4 opacity-20"></i><h3 className="text-lg font-medium mb-2">No trades yet</h3><p className="text-sm">Start trading based on AI predictions to build your trade history.</p></div></div>);}return (<div className="bg-gray-800 rounded-xl border border-gray-700 overflow-hidden"><div className="p-4 border-b border-gray-700 bg-gray-800/50"><h3 className="font-semibold text-gray-200 flex items-center gap-2"><i className="fa-solid fa-clock-rotate-left text-blue-400"></i>Recent Trades</h3></div><div className="overflow-x-auto"><table className="w-full text-sm text-left"><thead className="text-xs text-gray-400 uppercase bg-gray-700/30"><tr><th className="px-6 py-3">Time</th><th className="px-6 py-3">Symbol</th><th className="px-6 py-3">Direction</th><th className="px-6 py-3">Entry</th><th className="px-6 py-3">Exit</th><th className="px-6 py-3">Result</th></tr></thead><tbody>{trades.map((trade, idx) => (<tr key={idx} className="border-b border-gray-700 hover:bg-gray-700/20"><td className="px-6 py-4 text-gray-400">{trade.timestamp}</td><td className="px-6 py-4 font-medium text-gray-200">{trade.symbol}</td><td className="px-6 py-4"><span className={`px-2 py-1 rounded text-xs font-bold ${trade.direction === 'LONG'? 'bg-green-500/20 text-green-400': 'bg-red-500/20 text-red-400'}`}>{trade.direction}</span></td><td className="px-6 py-4 text-gray-300">{trade.entry}</td><td className="px-6 py-4 text-gray-300">{trade.exit}</td><td className={`px-6 py-4 font-bold ${trade.result === 'WIN'? 'text-green-400': trade.result === 'LOSS'? 'text-red-400': 'text-gray-400'}`}>{trade.result}</td></tr>))}</tbody></table></div></div>);};export default TradeHistory;1234import React from 'react';const TradeHistory = ({ trades }) => {if (trades.length === 0
components/TradeHistory.js+1-67