import Image from "next/image"; import Link from "next/link"; import { formatRupiah } from "@/lib/utils"; import { formatTripCalendarDateRangeLong } from "@/lib/trip-dates"; import { categoryMeta } from "@/lib/activity-category"; import type { ActivityCategory } from "@/app/generated/prisma/enums"; interface TripCardProps { id: string; title: string; category: ActivityCategory; destination: 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, category, destination, location, date, endDate, price, maxParticipants, participantCount, organizerName, status, coverImage, priority, isVerifiedOrganizer, }: TripCardProps) { const spotsLeft = maxParticipants - participantCount; const isSmallGroup = maxParticipants <= 10; const meta = categoryMeta(category); return (
{/* Cover Image */}
{coverImage ? ( {title} ) : (
{meta.icon}
)} {meta.icon} {meta.label} {status}
{/* Content */}

{title}

{destination}

📍 {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"}
); }