11import { HoverPopover } from '@panwatch/base-ui/components/ui/hover-popover'
22import type { KlineSummaryData } from '@panwatch/biz-ui/components/kline-summary-dialog'
3+ import { TechnicalBadge } from '@panwatch/biz-ui/components/technical-badge'
34
45interface KlineIndicatorsProps {
56 summary : KlineSummaryData
@@ -29,7 +30,7 @@ export function KlineIndicators({ summary: s }: KlineIndicatorsProps) {
2930 </ div >
3031 </ div >
3132 }
32- trigger = { < span className = "px-2 py-0.5 rounded bg-accent/50 text-muted-foreground cursor- help hover:bg-accent/70" > { s . trend } </ span > }
33+ trigger = { < TechnicalBadge label = { s . trend } tone = "neutral" help / >}
3334 />
3435 ) }
3536
@@ -52,7 +53,7 @@ export function KlineIndicators({ summary: s }: KlineIndicatorsProps) {
5253 </ div >
5354 </ div >
5455 }
55- trigger = { < span className = "px-2 py-0.5 rounded bg-accent/50 text-muted-foreground cursor-help hover:bg-accent/70" > MACD { s . macd_status } </ span > }
56+ trigger = { < TechnicalBadge label = { ` MACD $ {s . macd_status } ` } tone = "neutral" help / >}
5657 />
5758 ) }
5859
@@ -75,51 +76,57 @@ export function KlineIndicators({ summary: s }: KlineIndicatorsProps) {
7576 </ div >
7677 </ div >
7778 }
78- trigger = { < span className = { `px-2 py-0.5 rounded ${
79- s . rsi_status === '超买' ? 'bg-rose-500/10 text-rose-600' :
80- s . rsi_status === '超卖' ? 'bg-emerald-500/10 text-emerald-600' :
81- 'bg-accent/50 text-muted-foreground'
82- } cursor-help hover:bg-accent/70`} > RSI { s . rsi_status } { s . rsi6 != null && ` (${ s . rsi6 . toFixed ( 0 ) } )` } </ span > }
79+ trigger = {
80+ < TechnicalBadge
81+ label = { `RSI ${ s . rsi_status } ${ s . rsi6 != null ? ` (${ s . rsi6 . toFixed ( 0 ) } )` : '' } ` }
82+ tone = { s . rsi_status === '超买' ? 'bullish' : s . rsi_status === '超卖' ? 'bearish' : 'neutral' }
83+ help
84+ />
85+ }
8386 />
8487 ) }
8588
8689 { s . kdj_status && (
8790 < HoverPopover
8891 title = "KDJ(转折/超买超卖)"
8992 content = { < div > J 值更敏感,金叉/死叉用于观察短期转折,但容易受震荡干扰,需结合趋势与量价。</ div > }
90- trigger = { < span className = "px-2 py-0.5 rounded bg-accent/50 text-muted-foreground cursor-help hover:bg-accent/70" > KDJ { s . kdj_status } </ span > }
93+ trigger = { < TechnicalBadge label = { ` KDJ $ {s . kdj_status } ` } tone = "neutral" help / >}
9194 />
9295 ) }
9396
9497 { s . volume_trend && (
9598 < HoverPopover
9699 title = "量能(成交量配合)"
97100 content = { < div > 放量常用于确认突破或反弹有效性;缩量上冲/下跌容易“虚”。与趋势、关键位结合更可靠。</ div > }
98- trigger = { < span className = { `px-2 py-0.5 rounded ${
99- s . volume_trend === '放量' ? 'bg-amber-500/10 text-amber-600' :
100- s . volume_trend === '缩量' ? 'bg-blue-500/10 text-blue-600' :
101- 'bg-accent/50 text-muted-foreground'
102- } cursor-help hover:bg-accent/70`} > { s . volume_trend } { s . volume_ratio != null && ` (${ s . volume_ratio . toFixed ( 1 ) } x)` } </ span > }
101+ trigger = {
102+ < TechnicalBadge
103+ label = { `${ s . volume_trend } ${ s . volume_ratio != null ? ` (${ s . volume_ratio . toFixed ( 1 ) } x)` : '' } ` }
104+ tone = { s . volume_trend === '放量' ? 'warning' : s . volume_trend === '缩量' ? 'info' : 'neutral' }
105+ help
106+ />
107+ }
103108 />
104109 ) }
105110
106111 { s . boll_status && (
107112 < HoverPopover
108113 title = "布林带(波动/偏离)"
109114 content = { < div > 上轨/下轨的突破/跌破常见于趋势阶段或极端波动。配合量能与回踩/站稳确认有效性。</ div > }
110- trigger = { < span className = { `px-2 py-0.5 rounded ${
111- s . boll_status === '突破上轨' ? 'bg-rose-500/10 text-rose-600' :
112- s . boll_status === '跌破下轨' ? 'bg-emerald-500/10 text-emerald-600' :
113- 'bg-accent/50 text-muted-foreground'
114- } cursor-help hover:bg-accent/70`} > 布林 { s . boll_status } </ span > }
115+ trigger = {
116+ < TechnicalBadge
117+ label = { `布林 ${ s . boll_status } ` }
118+ tone = { s . boll_status === '突破上轨' ? 'bullish' : s . boll_status === '跌破下轨' ? 'bearish' : 'neutral' }
119+ help
120+ />
121+ }
115122 />
116123 ) }
117124
118125 { s . kline_pattern && (
119126 < HoverPopover
120127 title = "K线形态(局部结构)"
121128 content = { < div > 单根形态提示意义有限,更看重所处位置(趋势/支撑压力附近)与量能配合。</ div > }
122- trigger = { < span className = "px-2 py-0.5 rounded bg-amber-500/10 text-amber-600 cursor- help hover:bg-amber-500/15" > { s . kline_pattern } </ span > }
129+ trigger = { < TechnicalBadge label = { s . kline_pattern } tone = "warning" help / >}
123130 />
124131 ) }
125132 </ div >
@@ -130,14 +137,14 @@ export function KlineIndicators({ summary: s }: KlineIndicatorsProps) {
130137 < HoverPopover
131138 title = "支撑位(关键支撑区)"
132139 content = { < div > 接近支撑更容易止跌反弹;放量跌破可能转为压力。更偏向“区域”而非一点。</ div > }
133- trigger = { < span className = "px-2 py-0.5 rounded bg-emerald-500/10 text-emerald-600 cursor-help hover:bg-emerald-500/15" > 支撑 { s . support . toFixed ( 2 ) } </ span > }
140+ trigger = { < TechnicalBadge label = { ` 支撑 $ {s . support . toFixed ( 2 ) } ` } tone = "bearish" help / >}
134141 />
135142 ) }
136143 { s . resistance != null && (
137144 < HoverPopover
138145 title = "压力位(关键压力区)"
139146 content = { < div > 越接近压力上行越难;放量突破并站稳后,原压力往往会角色互换变为支撑。</ div > }
140- trigger = { < span className = "px-2 py-0.5 rounded bg-rose-500/10 text-rose-600 cursor-help hover:bg-rose-500/15" > 压力 { s . resistance . toFixed ( 2 ) } </ span > }
147+ trigger = { < TechnicalBadge label = { ` 压力 $ {s . resistance . toFixed ( 2 ) } ` } tone = "bullish" help / >}
141148 />
142149 ) }
143150 </ div >
0 commit comments