import { Link } from 'react-router-dom';
import { TrendingUp, TrendingDown, Minus, ChevronRight } from 'lucide-react';
import type { StockAnalysis, Decision } from '../types';
interface StockCardProps {
stock: StockAnalysis;
showDetails?: boolean;
compact?: boolean;
}
export function DecisionBadge({ decision, size = 'default' }: { decision: Decision | null; size?: 'small' | 'default' }) {
if (!decision) return null;
const config = {
BUY: {
bg: 'bg-green-100 dark:bg-green-900/30',
text: 'text-green-800 dark:text-green-400',
icon: TrendingUp,
},
SELL: {
bg: 'bg-red-100 dark:bg-red-900/30',
text: 'text-red-800 dark:text-red-400',
icon: TrendingDown,
},
HOLD: {
bg: 'bg-amber-100 dark:bg-amber-900/30',
text: 'text-amber-800 dark:text-amber-400',
icon: Minus,
},
};
const { bg, text, icon: Icon } = config[decision];
const sizeClasses = size === 'small'
? 'px-2 py-0.5 text-xs gap-1'
: 'px-2.5 py-0.5 text-xs gap-1';
const iconSize = size === 'small' ? 'w-3 h-3' : 'w-3.5 h-3.5';
return (
{stock.company_name}
{showDetails && (