feat: add version, anti-cheat, and verified date to preset detail modal (Tasks 6.1-6.7)
This commit is contained in:
@@ -157,6 +157,10 @@ interface Preset {
|
|||||||
createdAt: string
|
createdAt: string
|
||||||
hardwareWattHours: number | null
|
hardwareWattHours: number | null
|
||||||
hardwareDeviceType: string | null
|
hardwareDeviceType: string | null
|
||||||
|
versionString: string | null
|
||||||
|
buildId: string | null
|
||||||
|
gameAntiCheatName: string | null
|
||||||
|
gameAntiCheatStatus: "none" | "supported" | "unsupported" | "unknown" | null
|
||||||
}
|
}
|
||||||
|
|
||||||
interface StatsResponse {
|
interface StatsResponse {
|
||||||
|
|||||||
@@ -182,6 +182,10 @@ export default async function GamePage({
|
|||||||
youtubeVideoId: performanceEntries.youtubeVideoId,
|
youtubeVideoId: performanceEntries.youtubeVideoId,
|
||||||
customSystem: performanceEntries.customSystem,
|
customSystem: performanceEntries.customSystem,
|
||||||
userNotes: performanceEntries.userNotes,
|
userNotes: performanceEntries.userNotes,
|
||||||
|
versionString: gameVersions.versionString,
|
||||||
|
buildId: gameVersions.buildId,
|
||||||
|
gameAntiCheatName: gamePlatformSupport.antiCheatName,
|
||||||
|
gameAntiCheatStatus: gamePlatformSupport.antiCheatStatus,
|
||||||
verifiedAt: performanceEntries.verifiedAt,
|
verifiedAt: performanceEntries.verifiedAt,
|
||||||
isPinned: performanceEntries.isPinned,
|
isPinned: performanceEntries.isPinned,
|
||||||
pinnedAt: performanceEntries.pinnedAt,
|
pinnedAt: performanceEntries.pinnedAt,
|
||||||
@@ -190,6 +194,13 @@ export default async function GamePage({
|
|||||||
.innerJoin(gameVersions, eq(performanceEntries.versionId, gameVersions.id))
|
.innerJoin(gameVersions, eq(performanceEntries.versionId, gameVersions.id))
|
||||||
.innerJoin(hardware, eq(performanceEntries.hardwareSlug, hardware.slug))
|
.innerJoin(hardware, eq(performanceEntries.hardwareSlug, hardware.slug))
|
||||||
.innerJoin(user, eq(performanceEntries.userId, user.id))
|
.innerJoin(user, eq(performanceEntries.userId, user.id))
|
||||||
|
.innerJoin(
|
||||||
|
gamePlatformSupport,
|
||||||
|
and(
|
||||||
|
eq(gamePlatformSupport.gameId, gameVersions.gameId),
|
||||||
|
eq(gamePlatformSupport.hardwareSlug, performanceEntries.hardwareSlug),
|
||||||
|
),
|
||||||
|
)
|
||||||
.where(
|
.where(
|
||||||
and(
|
and(
|
||||||
eq(gameVersions.gameId, game.id),
|
eq(gameVersions.gameId, game.id),
|
||||||
@@ -287,6 +298,10 @@ export default async function GamePage({
|
|||||||
hardwareDeviceType: null as string | null,
|
hardwareDeviceType: null as string | null,
|
||||||
customSystem: p.customSystem ?? false,
|
customSystem: p.customSystem ?? false,
|
||||||
userNotes: p.userNotes,
|
userNotes: p.userNotes,
|
||||||
|
versionString: p.versionString ?? null,
|
||||||
|
buildId: p.buildId ?? null,
|
||||||
|
gameAntiCheatName: p.gameAntiCheatName ?? null,
|
||||||
|
gameAntiCheatStatus: p.gameAntiCheatStatus ?? null,
|
||||||
userId: p.userId,
|
userId: p.userId,
|
||||||
userName: p.userName,
|
userName: p.userName,
|
||||||
userImage: p.userImage,
|
userImage: p.userImage,
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ interface Preset {
|
|||||||
isPinned: boolean
|
isPinned: boolean
|
||||||
pinnedAt: string | null
|
pinnedAt: string | null
|
||||||
createdAt: string
|
createdAt: string
|
||||||
|
versionString: string | null
|
||||||
|
buildId: string | null
|
||||||
|
gameAntiCheatName: string | null
|
||||||
|
gameAntiCheatStatus: "none" | "supported" | "unsupported" | "unknown" | null
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PresetDetailModalProps {
|
interface PresetDetailModalProps {
|
||||||
@@ -281,11 +285,11 @@ export function PresetDetailModal({
|
|||||||
{preset.userName || "Anonymous"}
|
{preset.userName || "Anonymous"}
|
||||||
</span>
|
</span>
|
||||||
{preset.verifiedAt && (
|
{preset.verifiedAt && (
|
||||||
<span
|
<span className="inline-flex items-center gap-1 text-green-400">
|
||||||
className="inline-flex items-center gap-0.5 text-green-400"
|
|
||||||
title="Verified"
|
|
||||||
>
|
|
||||||
<ShieldCheckIcon className="h-3.5 w-3.5" />
|
<ShieldCheckIcon className="h-3.5 w-3.5" />
|
||||||
|
<span className="text-[10px]">
|
||||||
|
Verified on {new Date(preset.verifiedAt).toLocaleDateString(undefined, { year: "numeric", month: "short", day: "numeric" })}
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -496,6 +500,18 @@ export function PresetDetailModal({
|
|||||||
|
|
||||||
{/* Metadata */}
|
{/* Metadata */}
|
||||||
<div className="flex flex-col gap-3">
|
<div className="flex flex-col gap-3">
|
||||||
|
{preset.versionString && (
|
||||||
|
<MetaItem label="Version" value={`v${preset.versionString}`} />
|
||||||
|
)}
|
||||||
|
{preset.buildId && (
|
||||||
|
<MetaItem label="Build" value={String(preset.buildId)} />
|
||||||
|
)}
|
||||||
|
{preset.gameAntiCheatName && (
|
||||||
|
<MetaItem
|
||||||
|
label="Anti-Cheat"
|
||||||
|
value={`${preset.gameAntiCheatName} (${preset.gameAntiCheatStatus ?? "unknown"})`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<MetaItem label="Proton" value={preset.protonVersion} />
|
<MetaItem label="Proton" value={preset.protonVersion} />
|
||||||
<MetaItem label="OS" value={preset.osVersion} />
|
<MetaItem label="OS" value={preset.osVersion} />
|
||||||
{preset.tdpWatts !== null && (
|
{preset.tdpWatts !== null && (
|
||||||
|
|||||||
Reference in New Issue
Block a user