import type { StockAIAnalysis } from '@/lib/actions/stock-analysis.helpers'; interface StockAIAnalysisCardProps { analysis: StockAIAnalysis | null; } function getStanceClasses(stance: StockAIAnalysis['stance']) { if (stance === 'Bullish') return 'border-emerald-500/30 bg-emerald-500/10 text-emerald-300'; if (stance === 'Bearish') return 'border-rose-500/30 bg-rose-500/10 text-rose-300'; return 'border-amber-500/30 bg-amber-500/10 text-amber-200'; } function renderList(title: string, items: string[]) { return (

{title}

{items.length ? ( ) : (

No additional signals generated.

)}
); } export default function StockAIAnalysisCard({ analysis }: StockAIAnalysisCardProps) { if (!analysis) { return (

AI Stock Analysis

Professional research note unavailable

The stock dashboard data loaded, but an AI research note could not be generated right now.

); } return (

AI Stock Analysis

{analysis.companyName ? `${analysis.companyName} (${analysis.symbol})` : analysis.symbol}

{analysis.summary}

{analysis.stance} {analysis.confidence} confidence
{renderList('Key drivers', analysis.keyDrivers)} {renderList('Risks', analysis.risks)} {renderList('What to watch', analysis.watchItems)}

Educational analysis only. Use it as a synthesis of the dashboard inputs, not as personal financial advice.

); }