Refactor: Hide zero counts in search

This commit is contained in:
gpt-engineer-app[bot]
2025-09-29 14:58:27 +00:00
parent 7581ba053b
commit 71f0b5e33f
4 changed files with 16 additions and 6 deletions

View File

@@ -90,7 +90,9 @@ export function DesignerCard({ company }: DesignerCardProps) {
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Star className="w-3 h-3 text-yellow-500 fill-yellow-500 flex-shrink-0" /> <Star className="w-3 h-3 text-yellow-500 fill-yellow-500 flex-shrink-0" />
<span className="font-medium">{company.average_rating.toFixed(1)}</span> <span className="font-medium">{company.average_rating.toFixed(1)}</span>
<span className="text-muted-foreground">({company.review_count} reviews)</span> {company.review_count > 0 && (
<span className="text-muted-foreground">({company.review_count} reviews)</span>
)}
</div> </div>
)} )}
</div> </div>

View File

@@ -104,7 +104,9 @@ export function ManufacturerCard({ company }: ManufacturerCardProps) {
<div className="flex items-center gap-1"> <div className="flex items-center gap-1">
<Star className="w-4 h-4 fill-yellow-400 text-yellow-400" /> <Star className="w-4 h-4 fill-yellow-400 text-yellow-400" />
<span className="text-sm font-medium">{company.average_rating.toFixed(1)}</span> <span className="text-sm font-medium">{company.average_rating.toFixed(1)}</span>
<span className="text-xs text-muted-foreground">({company.review_count} reviews)</span> {company.review_count > 0 && (
<span className="text-xs text-muted-foreground">({company.review_count} reviews)</span>
)}
</div> </div>
)} )}

View File

@@ -100,11 +100,15 @@ export function ParkCard({ park }: ParkCardProps) {
)} )}
</div> </div>
{park.average_rating > 0 && <div className="flex items-center gap-1"> {park.average_rating > 0 && (
<div className="flex items-center gap-1">
<Star className="w-3 h-3 fill-yellow-400 text-yellow-400" /> <Star className="w-3 h-3 fill-yellow-400 text-yellow-400" />
<span className="text-sm font-medium">{park.average_rating.toFixed(1)}</span> <span className="text-sm font-medium">{park.average_rating.toFixed(1)}</span>
<span className="text-xs text-muted-foreground">({park.review_count})</span> {park.review_count > 0 && (
</div>} <span className="text-xs text-muted-foreground">({park.review_count})</span>
)}
</div>
)}
</div> </div>
{/* Action Button */} {/* Action Button */}

View File

@@ -136,7 +136,9 @@ export function RideCard({ ride, showParkName = true, className }: RideCardProps
<div className="flex items-center gap-1"> <div className="flex items-center gap-1">
<Star className="w-3 h-3 fill-yellow-400 text-yellow-400" /> <Star className="w-3 h-3 fill-yellow-400 text-yellow-400" />
<span className="text-sm font-medium">{ride.average_rating.toFixed(1)}</span> <span className="text-sm font-medium">{ride.average_rating.toFixed(1)}</span>
<span className="text-xs text-muted-foreground">({ride.review_count})</span> {ride.review_count > 0 && (
<span className="text-xs text-muted-foreground">({ride.review_count})</span>
)}
</div> </div>
)} )}
</div> </div>