Refactor cards to navigate

This commit is contained in:
gpt-engineer-app[bot]
2025-09-29 13:00:26 +00:00
parent 0f476db478
commit bbfdddb94f
5 changed files with 126 additions and 124 deletions

View File

@@ -1,16 +1,19 @@
import { MapPin, Star, Users, Clock, Castle, FerrisWheel, Waves, Tent } from 'lucide-react';
import { useNavigate } from 'react-router-dom';
import { Card, CardContent } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
import { Park } from '@/types/database';
interface ParkCardProps {
park: Park;
onClick?: () => void;
}
export function ParkCard({
park,
onClick
}: ParkCardProps) {
export function ParkCard({ park }: ParkCardProps) {
const navigate = useNavigate();
const handleClick = () => {
navigate(`/parks/${park.slug}`);
};
const getStatusColor = (status: string) => {
switch (status) {
case 'operating':
@@ -40,7 +43,7 @@ export function ParkCard({
const formatParkType = (type: string) => {
return type.split('_').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
};
return <Card className="group overflow-hidden border-border/50 bg-gradient-to-br from-card via-card to-card/80 hover:shadow-2xl hover:shadow-primary/20 transition-all duration-300 cursor-pointer hover:scale-[1.02]" onClick={onClick}>
return <Card className="group overflow-hidden border-border/50 bg-gradient-to-br from-card via-card to-card/80 hover:shadow-2xl hover:shadow-primary/20 transition-all duration-300 cursor-pointer hover:scale-[1.02]" onClick={handleClick}>
<div className="relative overflow-hidden">
{/* Image Placeholder with Gradient */}
<div className="aspect-video bg-gradient-to-br from-primary/20 via-secondary/20 to-accent/20 flex items-center justify-center relative">