mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 23:51:13 -05:00
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
This commit is contained in:
@@ -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(' ');
|
||||
|
||||
Reference in New Issue
Block a user