"use client";

import ReactLenis from "lenis/react";
import BlogCardOne from "@/components/sections/blog/BlogCardOne";
import FooterCard from "@/components/sections/footer/FooterCard";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline";
import { MapPin, Mail, Phone } from "lucide-react";
import { useBlogPosts } from "@/hooks/useBlogPosts";

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"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Destinations", id: "destinations" },
                            { name: "Packages", id: "packages" },
                            { name: "About", id: "about" },
                            { name: "Contact", id: "contact" }
                        ]}
                        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="Travel Stories & Insights"
                            description="Discover amazing destinations and travel tips from our expert guides"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    )}

                    <FooterCard
                        logoText="WanderLust"
                        copyrightText="© 2025 WanderLust Travel Agency. All rights reserved. Making dreams a destination."
                        socialLinks={[
                            { icon: MapPin, href: "https://maps.google.com", ariaLabel: "Our Locations" },
                            { icon: Mail, href: "mailto:hello@wanderlust.com", ariaLabel: "Email us" },
                            { icon: Phone, href: "tel:+1234567890", ariaLabel: "Call us" }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}