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(' ');