// frontend/src/components/PatternLog.tsx import React from 'react'; export interface PatternEvent { time: string; ticker: string; pattern: string; type: 'bullish' | 'bearish'; price: number; desc: string; } interface PatternLogProps { patterns: PatternEvent[]; } export const PatternLog: React.FC = ({ patterns }) => { return (

K 线形态自动识别日志 (K-Line Pattern Recognition Log)

{patterns.length === 0 ? (

回测时段内未识别到明显的标志性 K 线形态(如双底/双顶/锤子线等)。

) : ( patterns.map((item, idx) => { const isBullish = item.type === 'bullish'; const badgeColor = isBullish ? 'var(--color-green)' : 'var(--color-red)'; const bgBadgeColor = isBullish ? 'rgba(0, 200, 5, 0.12)' : 'rgba(255, 59, 48, 0.12)'; return (
{item.pattern} {item.ticker} @ ${item.price.toFixed(2)}
{item.time}
{item.desc}
); }) )}
); };