mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 12:31:12 -05:00
Refactor: Hide zero counts in search
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -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 */}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user