fix: Fix player profile loading with API transformer and improve UI layout
- Add LegacyPlayerProfile transformer to handle API response format mismatch - Transform avatar hashes to full Steam CDN URLs - Map team IDs correctly (API 1/2 -> Schema 2/3) - Calculate aggregate stats (avg_kills, avg_deaths, win_rate) from matches - Reduce featured matches on homepage from 6 to 3 - Show 4 recent matches on player profile instead of 10 - Display recent matches in 4-column grid on desktop (side-by-side) Fixes "Player not found" error for all player profiles. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -10,11 +10,11 @@ export const load: PageLoad = async ({ parent }) => {
|
||||
await parent();
|
||||
|
||||
try {
|
||||
// Load featured matches (limit to 6 for homepage)
|
||||
const matchesData = await api.matches.getMatches({ limit: 6 });
|
||||
// Load featured matches (limit to 3 for homepage)
|
||||
const matchesData = await api.matches.getMatches({ limit: 3 });
|
||||
|
||||
return {
|
||||
featuredMatches: matchesData.matches.slice(0, 6), // Ensure max 6 matches
|
||||
featuredMatches: matchesData.matches.slice(0, 3), // Ensure max 3 matches
|
||||
meta: {
|
||||
title: 'CS2.WTF - Statistics for CS2 Matchmaking',
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user