"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 { 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="Serengeti Safari"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Experiences", id: "features" },
                            { name: "About", id: "about" },
                            { name: "Testimonials", id: "testimonial" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Reserve 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="Safari Adventures Blog"
                            description="Discover the wonders of Serengeti wildlife through our expert guides' stories and insights"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Latest Updates"
                        />
                    )}

                    <FooterCard
                        logoText="Serengeti Safari"
                        copyrightText="© 2024 Serengeti Safari | Exclusive African Wildlife Experiences in Tanzania"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}