import Link from "next/link"; import { tripService } from "@/server/services/trip.service"; import { TripCard } from "@/features/trip/components/trip-card"; import { SearchBar } from "@/features/trip/components/search-bar"; export default async function HomePage() { const trips = await tripService.getOpenTrips(); const now = new Date(); const nextWeek = new Date(now.getTime() + 7 * 24 * 60 * 60 * 1000); const upcomingTrips = trips.filter((t) => new Date(t.date) <= nextWeek); const budgetTrips = trips.filter((t) => t.price <= 300000).slice(0, 3); const latestTrips = trips.slice(0, 6); return (
{/* ========== HERO ========== */}
{/* Gradient overlay */}
{/* Brand */}
🏔️ Open Trip Pendakian Gunung

SeTrip

Masa cowok sejati, cewek seimut nggak{" "} SeTrip bareng?

Yuk mulai dari sini. Cari open trip pendakian, gabung bareng, nikmati petualangan ke gunung-gunung Jawa Barat.

{/* Stats */}

{trips.length}

Trip Tersedia

8

Gunung Jabar

100%

Seru

{/* ========== CONTENT ========== */}
{/* Trip Terdekat */} {upcomingTrips.length > 0 && (
🔥

Trip Terdekat

Berangkat dalam 7 hari ke depan

{upcomingTrips.slice(0, 3).map((trip) => ( ))}
)} {/* Open Trip */}
🏔️

Open Trip

Pendakian gunung bareng teman baru

Lihat semua
{latestTrips.length === 0 ? (
🏕️

Belum ada trip tersedia

Jadilah yang pertama buat open trip pendakian!

+ Buat Trip Baru
) : (
{latestTrips.map((trip) => ( ))}
)}
{/* Budget Friendly */} {budgetTrips.length > 0 && (
💸

Budget Friendly

Trip di bawah Rp 300.000

{budgetTrips.map((trip) => ( ))}
)} {/* CTA Bottom */}

Siap naik gunung?

Buat trip sendiri atau gabung trip yang sudah ada. Seru bareng teman baru!

Buat Trip Cari Trip
{/* ========== FAB ========== */} +
); }