"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="expand-hover"
            defaultTextAnimation="background-highlight"
            borderRadius="pill"
            contentWidth="compact"
            sizing="mediumLargeSizeLargeTitles"
            background="aurora"
            cardStyle="gradient-radial"
            primaryButtonStyle="radial-glow"
            secondaryButtonStyle="layered"
            headingFontWeight="light"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleCentered
                        brandName="The Freezer"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Crew", id: "team" },
                            { name: "Lifestyle", id: "features" },
                            { name: "Connect", id: "contact" }
                        ]}
                        button={{ text: "Join Us", href: "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="Stories from the brotherhood - adventures, lifestyle, and the bonds that unite us"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Brotherhood"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBaseCard
                        logoText="The Freezer"
                        columns={[
                            {
                                title: "House",                                items: [
                                    { label: "About Us", href: "#about" },
                                    { label: "Our Crew", href: "#team" },
                                    { label: "Lifestyle", href: "#features" }
                                ]
                            },
                            {
                                title: "Fraternities",                                items: [
                                    { label: "Tau Kappa Epsilon", href: "#fraternities" },
                                    { label: "Sigma Alpha Epsilon", href: "#fraternities" }
                                ]
                            },
                            {
                                title: "Connect",                                items: [
                                    { label: "Get in Touch", href: "#contact" },
                                    { label: "Newsletter", href: "#contact" }
                                ]
                            },
                            {
                                title: "Location",                                items: [
                                    { label: "4923 Rockford Dr", href: "#" },
                                    { label: "San Diego, CA", href: "#" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 The Freezer | Brotherhood Lives Here"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}