"use client"; import { useTranslations } from "next-intl"; import { useRouter } from "next/navigation"; import { useState } from "react"; import { Calendar, ArrowRight } from "lucide-react"; import { tomorrowDateString, addMonths } from "@/src/lib/date"; interface BookingBannerProps { locale: string; } export function BookingBanner({ locale }: BookingBannerProps) { const t = useTranslations("home.bookingBanner"); const router = useRouter(); const [arrival, setArrival] = useState(tomorrowDateString()); const [months, setMonths] = useState(3); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); const departure = addMonths(arrival, months); const searchParams = new URLSearchParams({ arrival, departure, months: String(months), }); router.push(`/${locale}/houses?${searchParams.toString()}`); }; return (
setArrival(e.target.value)} className="w-full pl-4 pr-4 py-4 text-lg rounded-xl border-2 border-brand-grey-soft/60 bg-brand-grey-soft/20 text-brand-grey-dark focus:outline-none focus:ring-2 focus:ring-brand-green focus:border-transparent transition-all" />
setMonths(Number(e.target.value))} className="w-full px-4 py-4 text-lg text-center rounded-xl border-2 border-brand-grey-soft/60 bg-brand-grey-soft/20 text-brand-grey-dark focus:outline-none focus:ring-2 focus:ring-brand-green focus:border-transparent transition-all" />
); }