"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="hover-bubble"
            defaultTextAnimation="entrance-slide"
            borderRadius="pill"
            contentWidth="mediumSmall"
            sizing="large"
            background="floatingGradient"
            cardStyle="gradient-mesh"
            primaryButtonStyle="gradient"
            secondaryButtonStyle="solid"
            headingFontWeight="extrabold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleApple
                        brandName="The Freezer"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Team", id: "team" },
                            { name: "Vibe", id: "feature" },
                            { name: "Contact", id: "contact" }
                        ]}
                    />
                </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">
                        <BlogCardOne
                            blogs={posts}
                            title="The Freezer Chronicles"
                            description="Brotherhood stories, surf adventures, and lifestyle insights from the house"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBase
                        logoText="The Freezer House"
                        copyrightText="© 2025 The Freezer House | 4923 Rockford Dr, San Diego, CA | TKE & SAE Brotherhood"
                        columns={[
                            {
                                title: "Navigation",                                items: [
                                    { label: "Home", href: "hero" },
                                    { label: "About", href: "about" },
                                    { label: "Team", href: "team" }
                                ]
                            },
                            {
                                title: "Connect",                                items: [
                                    { label: "Contact", href: "contact" },
                                    { label: "Share Vibes", href: "#" }
                                ]
                            },
                            {
                                title: "Lifestyle",                                items: [
                                    { label: "Surfing", href: "#" },
                                    { label: "Fitness", href: "#" },
                                    { label: "Brotherhood", href: "#" }
                                ]
                            }
                        ]}
                        ariaLabel="Site footer"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}