"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="directional-hover"
            defaultTextAnimation="entrance-slide"
            borderRadius="pill"
            contentWidth="small"
            sizing="mediumLarge"
            background="floatingGradient"
            cardStyle="gradient-mesh"
            primaryButtonStyle="inset-glow"
            secondaryButtonStyle="radial-glow"
            headingFontWeight="light"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarLayoutFloatingOverlay
                        brandName="Luxury Hotels"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Rooms", id: "rooms" },
                            { name: "Amenities", id: "amenities" },
                            { name: "Pricing", id: "pricing" },
                            { name: "Testimonials", id: "testimonials" }
                        ]}
                        button={{ text: "Book Now", href: "#contact" }}
                    />

                    {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 Stories & Insights"
                            description="Discover the latest from our luxury hotel collection, featuring guest experiences, travel tips, and exclusive updates from our properties."
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    )}

                    <FooterLogoEmphasis
                        logoText="Luxury Hotels"
                        columns={[
                            {
                                items: [
                                    { label: "About Us", href: "#about" },
                                    { label: "Our Rooms", href: "#rooms" },
                                    { label: "Amenities", href: "#amenities" }
                                ]
                            },
                            {
                                items: [
                                    { label: "Pricing", href: "#pricing" },
                                    { label: "Testimonials", href: "#testimonials" },
                                    { label: "Contact", href: "#contact" }
                                ]
                            },
                            {
                                items: [
                                    { label: "Privacy Policy", href: "/privacy" },
                                    { label: "Terms of Service", href: "/terms" },
                                    { label: "Careers", href: "/careers" }
                                ]
                            },
                            {
                                items: [
                                    { label: "Email: info@luxuryhotels.com", href: "mailto:info@luxuryhotels.com" },
                                    { label: "Phone: +1 (555) 123-4567", href: "tel:+15551234567" },
                                    { label: "Address: 123 Resort Lane", href: "#" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}