import { MapPin, Star, Zap, Ruler, Clock, Factory, Castle } from 'lucide-react'; import { Card, CardContent } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { Ride } from '@/types/database'; import { cn } from '@/lib/utils'; interface RideListViewProps { rides: Ride[]; onRideClick: (ride: Ride) => void; } export function RideListView({ rides, onRideClick }: RideListViewProps) { const getStatusColor = (status: string) => { switch (status) { case 'operating': return 'bg-green-500/20 text-green-400 border-green-500/30'; case 'seasonal': return 'bg-yellow-500/20 text-yellow-400 border-yellow-500/30'; case 'under_construction': return 'bg-blue-500/20 text-blue-400 border-blue-500/30'; case 'closed': return 'bg-red-500/20 text-red-400 border-red-500/30'; default: return 'bg-gray-500/20 text-gray-400 border-gray-500/30'; } }; const formatCategory = (category: string) => { return category.split('_').map(word => word.charAt(0).toUpperCase() + word.slice(1) ).join(' '); }; return (
{rides.map((ride, index) => ( onRideClick(ride)} >
{/* Image */}
{ride.card_image_url ? ( <> {ride.name}
) : (
)} {/* Status Badge */} {ride.status.replace('_', ' ').toUpperCase()}
{/* Content */}
{/* Header */}

{ride.name}

{ride.park && (
{ride.park.name}
)} {ride.park?.location && (
{ride.park.location.city && `${ride.park.location.city}, `} {ride.park.location.country}
)}
{/* Rating */} {(ride.average_rating != null && ride.average_rating > 0) && (
{ride.average_rating.toFixed(1)}
)}
{/* Tags */}
{formatCategory(ride.category)} {ride.manufacturer && ( {ride.manufacturer.name} )}
{/* Actions */}
{ride.review_count && ride.review_count > 0 && ( {ride.review_count} reviews )}
))}
); }