diff --git a/app/(sharing)/[token]/[id]/page.tsx b/app/(sharing)/[token]/[id]/page.tsx index 61975a2..50f132c 100644 --- a/app/(sharing)/[token]/[id]/page.tsx +++ b/app/(sharing)/[token]/[id]/page.tsx @@ -1,6 +1,7 @@ import { getAuth } from "@/auth/queries/getauth"; import { generatePlaylogId, getSongsWithTitles } from "@/lib/api"; import { shareScore } from "../token"; +import { getDifficultyClass, getDifficultyText } from "@/lib/helpers"; export default async function Share({ params, @@ -13,19 +14,14 @@ export default async function Share({ const tokenResult = await shareScore(token); if (tokenResult.error) { - return
{tokenResult.error}
; } + const { user } = await getAuth(); - const { user } = await getAuth(); - - - if (!user?.UserId) { - return { - error:"no user id" + if (!user?.UserId) { + returnError: No user ID found.
; } -} const userId = user?.UserId; const playlogId = parseInt(id); @@ -33,17 +29,38 @@ export default async function Share({ const songsData = await getSongsWithTitles(userId); const playlogIds = await generatePlaylogId(playlogId); - const matchSongToPlaylogId = songsData.filter((song) => - playlogIds.includes(song.id) - ); - - const songTitles = matchSongToPlaylogId.map((song) => song.title); - + // Filter songsData to match the playlogIds + const matchedSongs = songsData.filter((song) => playlogIds.includes(song.id)); return ( -{song.title}
+Artist: {song.artist}
+Genre: {song.genre}
+diff: {song.chartlevel}
+ +Level: {song.level}
+ +Full Combo: {song.isFullCombo ? "Yes" : "No"}
+Score: {song.score}
+ +