feat: display all rating systems on player profile page
This commit is contained in:
@@ -20,6 +20,11 @@ export default async function PlayerProfilePage({ params }: PageProps) {
|
||||
|
||||
const player = await prisma.player.findUnique({
|
||||
where: { id: playerId },
|
||||
include: {
|
||||
eloRating: true,
|
||||
openSkillRating: true,
|
||||
glicko2Rating: true,
|
||||
},
|
||||
})
|
||||
|
||||
if (!player) {
|
||||
@@ -115,12 +120,16 @@ export default async function PlayerProfilePage({ params }: PageProps) {
|
||||
<p className="text-2xl font-bold text-gray-900">{player.currentElo}</p>
|
||||
</div>
|
||||
<div className="bg-gray-50 rounded-lg p-4 text-center">
|
||||
<p className="text-sm text-gray-500">Total Games</p>
|
||||
<p className="text-2xl font-bold text-gray-900">{totalGames}</p>
|
||||
<p className="text-sm text-gray-500">OpenSkill Rating</p>
|
||||
<p className="text-2xl font-bold text-gray-900">
|
||||
{player.openSkillRating?.rating?.toFixed(1) || 'N/A'}
|
||||
</p>
|
||||
</div>
|
||||
<div className="bg-gray-50 rounded-lg p-4 text-center">
|
||||
<p className="text-sm text-gray-500">Win Rate</p>
|
||||
<p className="text-2xl font-bold text-gray-900">{winRate}%</p>
|
||||
<p className="text-sm text-gray-500">Glicko2 Rating</p>
|
||||
<p className="text-2xl font-bold text-gray-900">
|
||||
{player.glicko2Rating?.rating?.toFixed(1) || 'N/A'}
|
||||
</p>
|
||||
</div>
|
||||
<div className="bg-gray-50 rounded-lg p-4 text-center">
|
||||
<p className="text-sm text-gray-500">Best Partner</p>
|
||||
|
||||
Reference in New Issue
Block a user