import Image from "next/image"; import Link from "next/link"; import { formatRupiah } from "@/lib/utils"; import { formatTripCalendarDateRangeLong } from "@/lib/trip-dates"; interface TripCardProps { id: string; title: string; mountain: string; location: string; date: Date | string; endDate?: Date | string | null; price: number; maxParticipants: number; participantCount: number; organizerName: string; status: string; coverImage?: string | null; priority?: boolean; isVerifiedOrganizer?: boolean; } export function TripCard({ id, title, mountain, location, date, endDate, price, maxParticipants, participantCount, organizerName, status, coverImage, priority, isVerifiedOrganizer, }: TripCardProps) { const spotsLeft = maxParticipants - participantCount; const isSmallGroup = maxParticipants <= 10; return (
{/* Cover Image */}
{coverImage ? ( {title} ) : (
🏔️
)} {status}
{/* Content */}

{title}

{mountain}

📍 {location}
📅{" "} {formatTripCalendarDateRangeLong(date, endDate)}
👤{" "} {organizerName} {isVerifiedOrganizer && ( ✅ Verified )} {isSmallGroup && ( Small group )}
{formatRupiah(price)} 0 ? "text-secondary-600" : "text-amber-600" }`} > {spotsLeft > 0 ? `${spotsLeft} slot tersisa` : "Penuh"}
); }