From 21bd9627673f38c3c84305a208568bd3f7e43612 Mon Sep 17 00:00:00 2001 From: pac7 <47831526-pac7@users.noreply.replit.com> Date: Wed, 8 Oct 2025 18:32:24 +0000 Subject: [PATCH] Improve ride model card to show unknown for missing category or type Update RideModelCardProps to accept null or undefined for category and type, returning 'Unknown' if they are not provided. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 567218be-0199-4aaa-af7e-8307f67d4453 Replit-Commit-Checkpoint-Type: intermediate_checkpoint --- src/components/rides/RideModelCard.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/rides/RideModelCard.tsx b/src/components/rides/RideModelCard.tsx index fe4eca9f..802bc105 100644 --- a/src/components/rides/RideModelCard.tsx +++ b/src/components/rides/RideModelCard.tsx @@ -13,13 +13,15 @@ interface RideModelCardProps { export function RideModelCard({ model, manufacturerSlug }: RideModelCardProps) { const navigate = useNavigate(); - const formatCategory = (category: string) => { + const formatCategory = (category: string | null | undefined) => { + if (!category) return 'Unknown'; return category.split('_').map(word => word.charAt(0).toUpperCase() + word.slice(1) ).join(' '); }; - const formatRideType = (type: string) => { + const formatRideType = (type: string | null | undefined) => { + if (!type) return 'Unknown'; return type.split('_').map(word => word.charAt(0).toUpperCase() + word.slice(1) ).join(' ');