"use client"; import { useState } from "react"; import { CreditCard, Building2, ScrollText, Crown, Sparkles } from "lucide-react"; import { SectionHeading } from "@/components/ui/SectionHeading"; import { Reveal } from "@/components/ui/Reveal"; import { BookingModal } from "@/components/ui/BookingModal"; import type { SiteContent } from "@/types/content"; type Tab = "prices" | "rental" | "rules"; interface PricingProps { data: SiteContent["pricing"]; } export function Pricing({ data: pricing }: PricingProps) { const [activeTab, setActiveTab] = useState("prices"); const [bookingOpen, setBookingOpen] = useState(false); const tabs: { id: Tab; label: string; icon: React.ReactNode }[] = [ { id: "prices", label: "Абонементы", icon: }, { id: "rental", label: "Аренда зала", icon: }, { id: "rules", label: "Правила", icon: }, ]; // Split items: featured (big card) vs regular const featuredItem = pricing.items.find((item) => item.featured); const regularItems = pricing.items.filter((item) => !item.featured); return (
{pricing.title} {/* Tabs */}
{tabs.map((tab) => ( ))}
{/* Prices tab */} {activeTab === "prices" && (

{pricing.subtitle}

{/* Cards grid */}
{regularItems.map((item, i) => { const isPopular = item.popular ?? false; return ( ); })}
{/* Featured — big card */} {featuredItem && ( )}
)} {/* Rental tab */} {activeTab === "rental" && (
{pricing.rentalItems.map((item, i) => ( ))}
)} {/* Rules tab */} {activeTab === "rules" && (
{pricing.rules.map((rule, i) => (
{i + 1}

{rule}

))}
)}
setBookingOpen(false)} />
); }