import React from 'react'; import { Zap, ShoppingCart, Star } from 'lucide-react'; import { StockItem, MarketType, OrderType } from '../types'; interface StockRowProps { stock: StockItem; rank?: number; showRank?: boolean; showActions?: boolean; showRatioBar?: boolean; showPL?: { pl: number; percent: number }; isWatchlisted?: boolean; onClick?: () => void; onTrade?: (type: OrderType) => void; onToggleWatchlist?: () => void; } export const StockRow: React.FC = ({ stock, rank, showRank, showActions, showRatioBar, showPL, isWatchlisted, onClick, onTrade, onToggleWatchlist }) => { return ( {showRank && ( {rank} )}
{onToggleWatchlist && ( )}
{stock.name[0]}
{stock.name} {stock.code}
{stock.market === MarketType.DOMESTIC ? stock.price.toLocaleString() + '원' : '$' + stock.price} {showPL ? (
= 0 ? 'text-rose-500' : 'text-blue-600'}>

{showPL.pl.toLocaleString()}

({showPL.percent.toFixed(2)}%)

) : ( = 0 ? 'text-rose-500' : 'text-blue-600'}`}> {stock.changePercent >= 0 ? '+' : ''}{stock.changePercent}% )} {showRatioBar && (
{stock.buyRatio || 50} {stock.sellRatio || 50}
)} {showActions && onTrade && (
)} ); };