@@ -13,7 +13,7 @@ import { invoke } from "@tauri-apps/api/core";
1313// M8:轮询/事件双通道/卡住检测抽入共用 hook(与 AiRefineCard 同源)
1414import { useAiTaskPolling } from "../hooks/useAiTaskPolling" ;
1515import { failureGuide } from "./aiTaskFailure" ;
16- import { Button } from "../ui/primitives" ;
16+ import { Button , StatusLine } from "../ui/primitives" ;
1717import type {
1818 AiEnrichResult ,
1919 AiSettingsView ,
@@ -260,16 +260,16 @@ export default function EnrichPanel({ noteId, onUpdated }: { noteId: number; onU
260260 { est . estCostYuan === 0 && est . priceKnown === false && < span style = { { color : "#d97706" } } > (该模型单价未登记,费用可能不准确)</ span > }
261261 </ div >
262262 { balance && (
263- < div style = { { color : balance . lowBalanceWarning ? "#dc2626 " : "#374151" } } >
263+ < StatusLine kind = { balance . lowBalanceWarning ? "error " : "info" } >
264264 当前余额:< strong > ¥{ balance . balance . totalBalance . toFixed ( 2 ) } </ strong >
265265 { balance . lowBalanceWarning && < span style = { { marginLeft : 6 } } > ⚠️ { balance . lowBalanceWarning } </ span > }
266- </ div >
266+ </ StatusLine >
267267 ) }
268268 { /* F3-D:成本硬拦截提示——余额不足时启动会被后端拒绝 */ }
269269 { balance && est . estCostYuan > 0 && balance . balance . totalBalance < est . estCostYuan * 1.2 && (
270- < div style = { { color : "#b91c1c" , marginTop : 2 } } >
270+ < StatusLine kind = "warn" >
271271 ⚠️ 余额不足本次预估(含安全系数)——启动将被拦截,请充值或切换免费档模型
272- </ div >
272+ </ StatusLine >
273273 ) }
274274 < div style = { { display : "flex" , gap : 6 , marginTop : 4 } } >
275275 < button style = { { ...btn , background : "#0d9488" , color : "#fff" , border : "none" } } onClick = { ( ) => void start ( ) } >
@@ -289,10 +289,12 @@ export default function EnrichPanel({ noteId, onUpdated }: { noteId: number; onU
289289
290290 { /* 失败 */ }
291291 { phase === "failed" && failure && (
292- < div style = { { fontSize : 12 , color : "#b91c1c" } } >
292+ < StatusLine
293+ kind = "error"
294+ action = { < button style = { { ...btn , marginLeft : 8 , border : "1px solid #d1d5db" } } onClick = { reset } > 重试</ button > }
295+ >
293296 ❌ { failureGuide ( failure , "未落任何补充内容" ) }
294- < button style = { { ...btn , marginLeft : 8 , border : "1px solid #d1d5db" } } onClick = { reset } > 重试</ button >
295- </ div >
297+ </ StatusLine >
296298 ) }
297299
298300 { /* 结果预览(扩展区预览 + 采纳/撤销) */ }
@@ -319,7 +321,7 @@ export default function EnrichPanel({ noteId, onUpdated }: { noteId: number; onU
319321 </ div >
320322 ) }
321323
322- { msg && < div style = { { fontSize : 11 , color : msg . startsWith ( "已" ) ? "#0d9488 " : "#dc2626" , marginTop : 4 } } > { msg } </ div > }
324+ { msg && < StatusLine kind = { msg . startsWith ( "已" ) ? "ok " : "error" } > { msg } </ StatusLine > }
323325 </ div >
324326 ) ;
325327}
0 commit comments