diff --git a/src/app/components/FeaturedYacht.tsx b/src/app/components/FeaturedYacht.tsx
index d0530b0..20b0b25 100644
--- a/src/app/components/FeaturedYacht.tsx
+++ b/src/app/components/FeaturedYacht.tsx
@@ -2,7 +2,6 @@
import { Card, CardContent } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
-import { DatePicker } from "@/components/ui/date-picker";
import {
Carousel,
CarouselContent,
@@ -13,7 +12,7 @@ import {
import Image from "next/image";
import Icon from "@/components/ui/icon";
import { useState } from "react";
-import { GuestPicker } from "@/components/form/guest-picker";
+import { GuestDatePicker } from "@/components/form/guest-date-picker";
const yacht = {
name: "Яхта",
@@ -140,7 +139,7 @@ export default function FeaturedYacht() {
{/* Promoted badge */}
{yacht.isPromoted && (
-
+
Это объявление продвигается.{" "}
@@ -152,7 +151,7 @@ export default function FeaturedYacht() {
{/* Right side - Booking form */}
-
+
{/* Promoted banner - Desktop only */}
{/* Booking form */}
-
+
{/* Book button */}
diff --git a/src/components/form/guest-date-picker.tsx b/src/components/form/guest-date-picker.tsx
new file mode 100644
index 0000000..5e4fe96
--- /dev/null
+++ b/src/components/form/guest-date-picker.tsx
@@ -0,0 +1,310 @@
+"use client";
+
+import React, { useState } from "react";
+import { format } from "date-fns";
+import { ru } from "date-fns/locale";
+import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
+
+import { Button } from "@/components/ui/button";
+import { Calendar } from "@/components/ui/calendar";
+import { Counter } from "@/components/ui/counter";
+import {
+ Popover,
+ PopoverContent,
+ PopoverTrigger,
+} from "@/components/ui/popover";
+
+interface GuestDatePickerProps {
+ onApply?: (data: {
+ date: Date | undefined;
+ departureTime: string;
+ arrivalTime: string;
+ adults: number;
+ children: number;
+ }) => void;
+ className?: string;
+}
+
+interface CommonPopoverContentProps {
+ date: Date | undefined;
+ setDate: (date: Date | undefined) => void;
+ departureTime: string;
+ setDepartureTime: (time: string) => void;
+ arrivalTime: string;
+ setArrivalTime: (time: string) => void;
+ adults: number;
+ setAdults: (count: number) => void;
+ childrenCount: number;
+ setChildrenCount: (count: number) => void;
+ handleApply: () => void;
+}
+
+const CommonPopoverContent: React.FC
= ({
+ date,
+ setDate,
+ departureTime,
+ setDepartureTime,
+ arrivalTime,
+ setArrivalTime,
+ adults,
+ setAdults,
+ childrenCount,
+ setChildrenCount,
+ handleApply,
+}) => {
+ return (
+
+ {/* Календарь */}
+
+
+ date < new Date(new Date().setHours(0, 0, 0, 0))
+ }
+ classNames={{
+ root: "w-full",
+ month: "flex w-full flex-col gap-4",
+ button_previous:
+ "h-8 w-8 flex items-center justify-center hover:bg-gray-100 rounded-md",
+ button_next:
+ "h-8 w-8 flex items-center justify-center hover:bg-gray-100 rounded-md",
+ month_caption:
+ "flex h-8 w-full items-center justify-center px-8 text-gray-700 font-semibold",
+ table: "w-full border-collapse",
+ weekdays: "flex",
+ weekday:
+ "flex-1 text-gray-500 text-xs font-normal p-2 text-center",
+ day_button: "font-bold ring-0 focus:ring-0",
+ week: "mt-2 flex w-full",
+ today: "bg-gray-100 text-gray-900 rounded-full",
+ outside: "text-gray-300",
+ disabled: "text-gray-400 cursor-not-allowed",
+ selected:
+ "rounded-full border-none outline-none !bg-brand text-white",
+ }}
+ />
+
+
+ {/* Счетчики гостей */}
+
+
+
+
+
+ {/* Поля времени */}
+
+
+
+
+
+ setDepartureTime(e.target.value)}
+ className="w-full focus:outline-none focus:border-transparent"
+ />
+
+
+
+
+
+
+
+ setArrivalTime(e.target.value)}
+ className="w-full focus:outline-none focus:border-transparent"
+ />
+
+
+
+
+ {/* Кнопка Применить */}
+
+
+ );
+};
+
+export const GuestDatePicker: React.FC = ({
+ onApply,
+ className,
+}) => {
+ const [date, setDate] = useState();
+ const [departureTime, setDepartureTime] = useState("12:00");
+ const [arrivalTime, setArrivalTime] = useState("13:00");
+ const [adults, setAdults] = useState(1);
+ const [children, setChildren] = useState(0);
+ const [isDepartureOpen, setIsDepartureOpen] = useState(false);
+ const [isArrivalOpen, setIsArrivalOpen] = useState(false);
+ const [isGuestOpen, setIsGuestOpen] = useState(false);
+
+ const handleApply = () => {
+ onApply?.({
+ date,
+ departureTime,
+ arrivalTime,
+ adults,
+ children,
+ });
+ setIsDepartureOpen(false);
+ setIsArrivalOpen(false);
+ setIsGuestOpen(false);
+ };
+
+ const getDepartureDisplayText = () => {
+ if (!date || !departureTime) return "Выход";
+
+ return (
+ <>
+ {format(date, "d MMMM", {
+ locale: ru,
+ })}
+ , {departureTime}
+ >
+ );
+ };
+
+ const getArrivalDisplayText = () => {
+ if (!date || !arrivalTime) return "Заход";
+
+ return (
+ <>
+ {format(date, "d MMMM", {
+ locale: ru,
+ })}
+ , {arrivalTime}
+ >
+ );
+ };
+
+ const getGuestDisplayText = () => {
+ if (adults === 1 && children === 0) return "1 гость";
+ return (
+
+ Взрослых: {adults}, Детей: {children}
+
+ );
+ };
+
+ return (
+
+
+ {/* Кнопка Выход */}
+
+
+
+
+
+
+
+ {/* Кнопка Заход */}
+
+
+
+
+
+
+
+ {/* Кнопка Гости */}
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/src/components/ui/counter.tsx b/src/components/ui/counter.tsx
index 6ad7089..a8c05f4 100644
--- a/src/components/ui/counter.tsx
+++ b/src/components/ui/counter.tsx
@@ -31,7 +31,7 @@ export const Counter: React.FC = ({
};
return (
-
+
diff --git a/src/types/icon.ts b/src/types/icon.ts
deleted file mode 100644
index 8b13789..0000000
--- a/src/types/icon.ts
+++ /dev/null
@@ -1 +0,0 @@
-