"use client";

import ReactLenis from "lenis/react";
import BlogCardOne from "@/components/sections/blog/BlogCardOne";
import FooterBase from "@/components/sections/footer/FooterBase";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
import { useBlogPosts } from "@/hooks/useBlogPosts";

export default function BlogPage() {
    const { posts, isLoading } = useBlogPosts();

    return (
        <ThemeProvider
            defaultButtonVariant="shift-hover"
            defaultTextAnimation="background-highlight"
            borderRadius="sharp"
            contentWidth="small"
            sizing="mediumLargeSizeLargeTitles"
            background="aurora"
            cardStyle="subtle-shadow"
            primaryButtonStyle="primary-glow"
            secondaryButtonStyle="solid"
            headingFontWeight="bold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarLayoutFloatingInline
                        brandName="Luxe Haven"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Rooms", id: "rooms" },
                            { name: "Amenities", id: "amenities" },
                            { name: "About", id: "about" },
                            { name: "Reviews", id: "testimonials" }
                        ]}
                        button={{ text: "Book Now", href: "pricing" }}
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardOne
                            blogs={posts}
                            title="Hotel News & Insights"
                            description="Discover the latest updates, travel tips, and luxury hospitality insights from Luxe Haven"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    )}

                    <FooterBase
                        logoText="Luxe Haven"
                        copyrightText="© 2025 Luxe Haven Hotels. All rights reserved."
                        columns={[
                            {
                                title: "Navigation",                                items: [
                                    { label: "Rooms", href: "rooms" },
                                    { label: "Amenities", href: "amenities" },
                                    { label: "About", href: "about" }
                                ]
                            },
                            {
                                title: "Information",                                items: [
                                    { label: "Contact Us", href: "#" },
                                    { label: "FAQ", href: "#" },
                                    { label: "Careers", href: "#" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms of Service", href: "#" },
                                    { label: "Cancellation Policy", href: "#" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}