2024-08-15 02:27:17 +00:00
|
|
|
import React, { FC } from "react";
|
|
|
|
import {
|
|
|
|
chuni_profile_rating,
|
|
|
|
chuni_static_music,
|
|
|
|
} from "@/prisma/schemas/artemis/generated/artemis";
|
2024-08-14 15:52:19 +00:00
|
|
|
|
2024-08-15 02:27:17 +00:00
|
|
|
type ChunithmRecent = chuni_profile_rating &
|
|
|
|
chuni_static_music & { rating: number; jacketPath: string | undefined };
|
2024-08-14 15:52:19 +00:00
|
|
|
|
|
|
|
type ChunithmProfileRecentPlays = {
|
|
|
|
chuniProfileRecentPlays: {
|
2024-08-15 02:27:17 +00:00
|
|
|
recentRating: ChunithmRecent[];
|
2024-08-14 15:52:19 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-08-15 02:27:17 +00:00
|
|
|
export const ChunithmRecentPlays: FC<ChunithmProfileRecentPlays> = ({
|
|
|
|
chuniProfileRecentPlays,
|
|
|
|
}) => {
|
2024-08-14 15:52:19 +00:00
|
|
|
return (
|
|
|
|
<div>
|
2024-08-15 02:27:17 +00:00
|
|
|
{chuniProfileRecentPlays.recentRating.map(
|
|
|
|
(playersRecentRatingList, index) => {
|
|
|
|
const jacketPath = playersRecentRatingList.jacketPath?.replace(
|
|
|
|
".dds",
|
|
|
|
".png",
|
|
|
|
);
|
|
|
|
|
|
|
|
return (
|
2024-08-15 02:31:58 +00:00
|
|
|
<div key={index} className="center flex p-2">
|
|
|
|
<div className="m-4 font-bold">{index + 1}.</div>
|
2024-08-15 02:27:17 +00:00
|
|
|
{jacketPath && (
|
|
|
|
<img
|
|
|
|
src={`/JacketArt/${jacketPath}`}
|
|
|
|
alt="Jacket"
|
|
|
|
style={{ width: "80px", height: "80px" }}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
<div>
|
|
|
|
<ul className="pl-2">
|
|
|
|
<li>
|
|
|
|
<strong>Title:</strong> {playersRecentRatingList.title}
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<strong>Score:</strong>{" "}
|
|
|
|
{playersRecentRatingList.score?.toLocaleString()}
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<strong>Rating:</strong>{" "}
|
|
|
|
{(playersRecentRatingList.rating / 100).toFixed(2)}
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
)}
|
2024-08-14 15:52:19 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|