({
rows,
participantId,
showTitle = true,
}: {
rows: LeaderboardRow[];
participantId?: string;
showTitle?: boolean;
})
| 1294 | } |
| 1295 | |
| 1296 | function Leaderboard({ |
| 1297 | rows, |
| 1298 | participantId, |
| 1299 | showTitle = true, |
| 1300 | }: { |
| 1301 | rows: LeaderboardRow[]; |
| 1302 | participantId?: string; |
| 1303 | showTitle?: boolean; |
| 1304 | }) { |
| 1305 | return ( |
| 1306 | <aside className="leaderboardPanel"> |
| 1307 | {showTitle ? ( |
| 1308 | <h2> |
| 1309 | <Trophy size={18} /> |
| 1310 | 挑战榜 |
| 1311 | </h2> |
| 1312 | ) : null} |
| 1313 | {rows.length === 0 ? ( |
| 1314 | <p>还没人点亮,来当第一个。</p> |
| 1315 | ) : ( |
| 1316 | rows.map((row, index) => ( |
| 1317 | <div key={row.id} className={`leaderRow ${row.id === participantId ? "mineRow" : ""}`}> |
| 1318 | <span>{index + 1}</span> |
| 1319 | <strong>{row.nickname}</strong> |
| 1320 | <em>{row.unlocked_cells} 格</em> |
| 1321 | </div> |
| 1322 | )) |
| 1323 | )} |
| 1324 | </aside> |
| 1325 | ); |
| 1326 | } |
| 1327 | |
| 1328 | function AdminView() { |
| 1329 | const [summary, setSummary] = useState<any>(null); |
nothing calls this directly
no outgoing calls
no test coverage detected