import { Col, Row, Tag } from 'antd' import { CheckCircleOutlined, CloudServerOutlined, ExclamationCircleOutlined, FireOutlined, ShoppingCartOutlined, } from '@ant-design/icons' import type { RockStats } from '../../api' export interface RockMetricCardsProps { stats: RockStats | null upstreamStock: number | null blackTokenCost: number availableStock: number warningStock: number isStockLow: boolean hasMismatch: boolean upstreamPoints: number maxPurchasable: number onOpenPurchase: (count: number) => void } export function RockMetricCards({ stats, upstreamStock, blackTokenCost, availableStock, warningStock, isStockLow, hasMismatch, upstreamPoints, maxPurchasable, onOpenPurchase, }: RockMetricCardsProps) { return (
上游可用库存 (0666.pro)
{upstreamStock === null ? '-' : upstreamStock} 个
采购单价: {blackTokenCost.toFixed(2)} 点/个 {upstreamStock === null ? ( 未获取 ) : upstreamStock === 0 ? ( 无库存 ) : ( 实时 )}
可用通用库存 (Available)
{availableStock} 个
警戒水位: {warningStock} 个 {isStockLow ? ( 库存紧缺 ) : ( 储备充足 )}
绑定错误阻断 (Mismatch)
{stats?.mismatch_stock ?? 0} 个
{hasMismatch ? 'UID强一致校验拦截保护' : '暂无异常阻断'} {hasMismatch ? ( 需核对处理 ) : ( 状态正常 )}
已履约交付 (Redeemed)
{stats?.redeemed_stock ?? 0} 个
当前扫码中 {stats?.using_stock ?? 0} 个
0666.pro 账号积分
{upstreamPoints.toFixed(1)} 点
账号: {stats?.username || '未同步'} onOpenPurchase(maxPurchasable > 0 ? Math.min(50, maxPurchasable) : 10)} style={{ fontWeight: 600, color: '#2563eb', cursor: 'pointer' }} title="点击快速打开手动采购弹窗" > 约可采购 {maxPurchasable} 个 ➔
) }