import { AlertTriangle, Building2, Gauge } from 'lucide-react'; import type { HydrogenMonthlyPoint } from '../../types'; import { formatKg as fmtKg } from '../model'; interface InsightCardsProps { monthAvgKg: number; bestMonth: HydrogenMonthlyPoint | null; latestMonth: HydrogenMonthlyPoint | undefined; monthMomentum: number | null; top5Share: number; profitYield: number; stationAvgKg: number; stationCount: number; yearProfitValue: string; yearProfitUnit: string; yearRevenueValue: string; yearRevenueUnit: string; } export function InsightCards({ monthAvgKg, bestMonth, latestMonth, monthMomentum, top5Share, profitYield, stationAvgKg, stationCount, yearProfitValue, yearProfitUnit, yearRevenueValue, yearRevenueUnit, }: InsightCardsProps) { return (
月度动能
{monthMomentum === null ? '暂无对比' : `${monthMomentum >= 0 ? '+' : ''}${monthMomentum.toFixed(1)}%`}
{latestMonth ? `${latestMonth.month} 加氢 ${fmtKg(latestMonth.kg).value}${fmtKg(latestMonth.kg).unit}` : '暂无月度数据'} {bestMonth ? ` · 峰值 ${bestMonth.month}` : ''} {monthAvgKg > 0 ? ` · 月均 ${fmtKg(monthAvgKg).value}${fmtKg(monthAvgKg).unit}` : ''}
站点集中度
Top5 {top5Share.toFixed(1)}%
共 {stationCount} 站 · 单站年均 {fmtKg(stationAvgKg).value}{fmtKg(stationAvgKg).unit} {top5Share >= 70 ? ' · 头部站点依赖偏高' : ' · 分布相对健康'}
收支健康度
= 0 ? 'text-emerald-600' : 'text-rose-600'}`}> {profitYield.toFixed(1)}%
= 0 ? 'bg-emerald-50 text-emerald-600 ring-emerald-100' : 'bg-rose-50 text-rose-600 ring-rose-100'}`}>
时享获利 {yearProfitValue}{yearProfitUnit} · 客户收入 {yearRevenueValue}{yearRevenueUnit} {profitYield < 0 ? ' · 需关注亏损站点与客户价格' : ' · 当前保持正向收益'}
); }