daphnis/components/userRatingBaseHotList/page.tsx

72 lines
2.0 KiB
TypeScript
Raw Normal View History

2024-08-16 19:08:33 +00:00
import React, { FC } from "react";
import { getDifficultyText } from "@/lib/helpers";
type userRatingBaseList = {
title: string;
artist: string;
genre: string;
chartId: string | number;
level: string | number;
jacketPath: string;
rating: number;
version: number;
index: number;
musicId: number | null;
difficultId: number | null;
score: number | null;
};
type ChunithmProfileHotPlays = {
chuniProfileHotPlays: {
hotRating: userRatingBaseList[];
};
};
export const ChunithmHotPlays: FC<ChunithmProfileHotPlays> = ({
chuniProfileHotPlays,
}) => {
return (
2024-08-17 02:00:51 +00:00
<div className="grid grid-cols-1 gap-2 md:grid-cols-8">
2024-08-16 19:08:33 +00:00
{chuniProfileHotPlays.hotRating.map((playerHotRatingList, index) => {
const jacketPath = playerHotRatingList.jacketPath?.replace(
".dds",
".png",
);
return (
2024-08-17 02:00:51 +00:00
<div key={index} className="flex flex-col items-center p-2">
<div className="m-4 font-bold"></div>
2024-08-16 19:08:33 +00:00
{jacketPath && (
<img
src={`/jacketArts/${jacketPath}`}
2024-08-16 19:08:33 +00:00
alt="Jacket"
style={{ width: "120px", height: "120px" }}
/>
)}
<div>
2024-08-17 02:00:51 +00:00
<ul className="mt-2 text-center">
2024-08-16 19:08:33 +00:00
<li>
<strong>Title: </strong> {playerHotRatingList.title}
</li>
<li>
<strong>Level: </strong> {playerHotRatingList.level}
</li>
<li>
<strong>Difficulty: </strong>
{getDifficultyText(Number(playerHotRatingList.chartId))}
</li>
<li>
<strong>Score: </strong>{" "}
{playerHotRatingList.score?.toLocaleString()}
</li>
<li>
<strong>Rating: </strong>{" "}
{(playerHotRatingList.rating / 100).toFixed(2)}
</li>
</ul>
</div>
</div>
);
})}
</div>
);
};