@cs2dak/react 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,53 +0,0 @@
1
- import { economyLabelCn, type EconomyConversion } from "@cs2dak/presentation";
2
-
3
- export interface EconomyConversionPanelProps {
4
- /** One team's per-economy-type conversion (from buildEconomyConversion). */
5
- stats: EconomyConversion;
6
- teamName: string;
7
- }
8
-
9
- export function EconomyConversionPanel({ stats, teamName }: EconomyConversionPanelProps) {
10
- const entries = Object.entries(stats).sort(([, a], [, b]) => b.winRate - a.winRate);
11
-
12
- if (entries.length === 0) {
13
- return (
14
- <div className="dak-econ-conv" aria-label={`${teamName} 经济转化率`}>
15
- <p className="dak-empty">暂无经济数据</p>
16
- </div>
17
- );
18
- }
19
-
20
- return (
21
- <div className="dak-econ-conv" aria-label={`${teamName} 经济转化率`}>
22
- <table className="dak-table">
23
- <thead>
24
- <tr>
25
- <th>经济类型</th>
26
- <th>回合</th>
27
- <th>胜</th>
28
- <th>胜率</th>
29
- <th className="dak-econ-conv-bar-col">胜率条</th>
30
- </tr>
31
- </thead>
32
- <tbody>
33
- {entries.map(([economy, s]) => (
34
- <tr key={economy}>
35
- <td>{economyLabelCn(economy)}</td>
36
- <td className="dak-mono">{s.played}</td>
37
- <td className="dak-mono">{s.won}</td>
38
- <td className="dak-mono">{(s.winRate * 100).toFixed(1)}%</td>
39
- <td className="dak-econ-conv-bar-col">
40
- <div className="dak-winrate-bar">
41
- <div
42
- className="dak-winrate-fill"
43
- style={{ width: `${Math.round(s.winRate * 100)}%` }}
44
- />
45
- </div>
46
- </td>
47
- </tr>
48
- ))}
49
- </tbody>
50
- </table>
51
- </div>
52
- );
53
- }