"use client";

import ReactLenis from "lenis/react";
import BlogCardThree from "@/components/sections/blog/BlogCardThree";
import FooterCard from "@/components/sections/footer/FooterCard";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline";
import { useBlogPosts } from "@/hooks/useBlogPosts";
import { Facebook, Instagram, Twitter, Linkedin } from "lucide-react";

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

    return (
        <ThemeProvider
            defaultButtonVariant="icon-arrow"
            defaultTextAnimation="entrance-slide"
            borderRadius="rounded"
            contentWidth="medium"
            sizing="medium"
            background="none"
            cardStyle="solid"
            primaryButtonStyle="shadow"
            secondaryButtonStyle="solid"
            headingFontWeight="medium"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarLayoutFloatingInline
                        brandName="Wanderlust Travels"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Destinations", id: "destinations" },
                            { name: "Services", id: "services" },
                            { name: "About", id: "about" },
                            { 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>
                    ) : (
                        <BlogCardThree
                            blogs={posts}
                            title="Travel Stories & Guides"
                            description="Discover amazing destinations, travel tips, and inspiring stories from our adventures around the world"
                            tag="Blog"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            animationType="slide-up"
                            carouselMode="buttons"
                            uniformGridCustomHeightClasses="min-h-[600px]"
                        />
                    )}

                    <FooterCard
                        logoText="Wanderlust Travels"
                        copyrightText="© 2024 Wanderlust Travels | Crafting Adventures Worldwide"
                        socialLinks={[
                            { icon: Facebook, href: "https://facebook.com/wanderlustravels", ariaLabel: "Facebook" },
                            { icon: Instagram, href: "https://instagram.com/wanderlustravels", ariaLabel: "Instagram" },
                            { icon: Twitter, href: "https://twitter.com/wanderlustravels", ariaLabel: "Twitter" },
                            { icon: Linkedin, href: "https://linkedin.com/company/wanderlustravels", ariaLabel: "LinkedIn" }
                        ]}
                        ariaLabel="Site footer with links and information"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}