Fix: Hide stats with no value

This commit is contained in:
gpt-engineer-app[bot]
2025-09-29 13:15:52 +00:00
parent 53331a4b03
commit aad67f5347

View File

@@ -444,24 +444,24 @@ export default function ParkDetail() {
</p> </p>
)} )}
{/* Stats */} {/* Stats */}
<div className="flex items-center gap-2 flex-wrap"> <div className="flex items-center gap-2 flex-wrap">
{ride.max_speed_kmh && ( {ride.max_speed_kmh && ride.max_speed_kmh > 0 && (
<span className="bg-primary/10 text-primary px-2 py-1 rounded-md text-xs font-medium"> <span className="bg-primary/10 text-primary px-2 py-1 rounded-md text-xs font-medium">
<MeasurementDisplay value={ride.max_speed_kmh} type="speed" /> <MeasurementDisplay value={ride.max_speed_kmh} type="speed" />
</span> </span>
)} )}
{ride.max_height_meters && ( {ride.max_height_meters && ride.max_height_meters > 0 && (
<span className="bg-accent/10 text-accent px-2 py-1 rounded-md text-xs font-medium"> <span className="bg-accent/10 text-accent px-2 py-1 rounded-md text-xs font-medium">
<MeasurementDisplay value={ride.max_height_meters} type="distance" /> <MeasurementDisplay value={ride.max_height_meters} type="distance" />
</span> </span>
)} )}
{ride.inversions > 0 && ( {ride.inversions > 0 && (
<span className="bg-secondary/10 text-secondary px-2 py-1 rounded-md text-xs font-medium"> <span className="bg-secondary/10 text-secondary px-2 py-1 rounded-md text-xs font-medium">
{ride.inversions} inversions {ride.inversions} inversions
</span> </span>
)} )}
</div> </div>
</div> </div>
</CardContent> </CardContent>
</Card> </Card>