MCPcopy Create free account
hub / github.com/ImGoodBai/MapGoGoGo / Leaderboard

Function Leaderboard

frontend/src/App.tsx:1296–1326  ·  view source on GitHub ↗
({
  rows,
  participantId,
  showTitle = true,
}: {
  rows: LeaderboardRow[];
  participantId?: string;
  showTitle?: boolean;
})

Source from the content-addressed store, hash-verified

1294}
1295
1296function 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
1328function AdminView() {
1329 const [summary, setSummary] = useState<any>(null);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected