import React from 'react';

interface TradePanelProps {
  hasBought: boolean;
  onToggleTrade: (type: 'BUY' | 'SELL') => void;
}

export const TradePanel: React.FC<TradePanelProps> = ({
  hasBought,
  onToggleTrade,
}: TradePanelProps) => {
  return (
    <div className="flex items-center justify-center p-4 bg-gray-800 rounded-lg shadow-lg">
      <div className="flex space-x-4">
        {hasBought ? (
          <button 
            onClick={() => onToggleTrade('SELL')}
            className="px-6 py-2 text-sm font-medium text-white bg-green-600 rounded-md hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 transition-colors"
          >
            卖出
          </button>
        ) : (
          <button 
            onClick={() => onToggleTrade('BUY')}
            className="px-6 py-2 text-sm font-medium text-white bg-red-600 rounded-md hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 transition-colors"
          >
            买入
          </button>
        )}
      </div>
    </div>
  );
}; 