"use client";

import ReactLenis from "lenis/react";
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
import FooterMedia from '@/components/sections/footer/FooterMedia';
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import { useBlogPosts } from "@/hooks/useBlogPosts";

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

    return (
        <ThemeProvider
            defaultButtonVariant="shift-hover"
            defaultTextAnimation="reveal-blur"
            borderRadius="pill"
            contentWidth="smallMedium"
            sizing="medium"
            background="floatingGradient"
            cardStyle="inset"
            primaryButtonStyle="primary-glow"
            secondaryButtonStyle="solid"
            headingFontWeight="extrabold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleFullscreen
                        brandName="Wanderlust Escapes"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Destinations", id: "destinations" },
                            { name: "About", id: "about" },
                            { name: "Experiences", id: "experiences" },
                            { name: "Testimonials", id: "testimonials" },
                            { name: "Contact", id: "contact" }
                        ]}
                        bottomLeftText="Luxury Travel Since 2010"
                        bottomRightText="hello@wanderlustescapes.com"
                    />
                </div>

                {isLoading ? (
                    <div className="w-content-width mx-auto py-20 text-center">
                        <p className="text-foreground">Loading posts...</p>
                    </div>
                ) : (
                    <div id="blog" data-section="blog">
                        <BlogCardTwo
                            blogs={posts}
                            title="Travel Insights & Stories"
                            description="Discover inspiring travel stories, destination guides, and expert tips for your next luxury adventure"
                            tag="Blog"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            animationType="slide-up"
                            carouselMode="buttons"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterMedia
                        imageSrc="https://img.b2bpic.net/free-photo/maldives-island_1203-7338.jpg"
                        imageAlt="Luxury travel experience footer"
                        logoText="Wanderlust Escapes"
                        copyrightText="© 2025 Wanderlust Escapes. All rights reserved."
                        columns={[
                            {
                                title: "Destinations",                                items: [
                                    { label: "Asia", href: "destinations" },
                                    { label: "Europe", href: "destinations" },
                                    { label: "Americas", href: "destinations" },
                                    { label: "Africa", href: "destinations" }
                                ]
                            },
                            {
                                title: "Services",                                items: [
                                    { label: "Custom Itineraries", href: "experiences" },
                                    { label: "Luxury Packages", href: "experiences" },
                                    { label: "Concierge Service", href: "about" },
                                    { label: "Group Travel", href: "contact" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "about" },
                                    { label: "Contact", href: "contact" },
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms of Service", href: "#" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}