feat: enrich game cards with bestFps, raw/poor performer badges, and battery estimates (Tasks 5.1-5.6)

This commit is contained in:
2026-05-10 05:17:55 +08:00
parent c704f35f51
commit 5875595219
5 changed files with 215 additions and 1 deletions
+14
View File
@@ -49,6 +49,7 @@ interface UnifiedResult {
isRawPerformer?: boolean
isPoorPerformance?: boolean
bestFps?: number | null
estimatedBatteryMin?: number | null
latestVersion?: string | null
tinyImage?: string | null
// Badges & review fields
@@ -567,6 +568,11 @@ function SearchResultCard({
POOR PERFORMANCE
</span>
)}
{result.estimatedBatteryMin != null && (
<span className="inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-blue-500/10 border border-blue-500/20 text-blue-400 text-[10px] font-semibold shrink-0">
🔋 ~{Math.round(result.estimatedBatteryMin / 60)}h
</span>
)}
</div>
{(result.developer || result.publisher) && (
<p className="text-[11px] text-text/45 mt-0.5 truncate">
@@ -751,6 +757,14 @@ function SearchResultCard({
color={result.bestFps != null && result.bestFps >= 60 ? "text-green-400" : undefined}
/>
{/* Battery Estimate */}
{result.estimatedBatteryMin != null && (
<DataField
label="Battery"
value={`~${Math.round(result.estimatedBatteryMin / 60)}h`}
/>
)}
{/* Version */}
<DataField
label="Version"