"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 NavbarStyleCentered from "@/components/navbar/NavbarStyleCentered/NavbarStyleCentered";
import { useBlogPosts } from "@/hooks/useBlogPosts";

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

    return (
        <ThemeProvider
            defaultButtonVariant="shift-hover"
            defaultTextAnimation="entrance-slide"
            borderRadius="pill"
            contentWidth="compact"
            sizing="mediumLargeSizeMediumTitles"
            background="floatingGradient"
            cardStyle="outline"
            primaryButtonStyle="shadow"
            secondaryButtonStyle="layered"
            headingFontWeight="normal"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleCentered
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Portfolio", id: "portfolio" },
                            { name: "Team", id: "team" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Start Investing", href: "contact" }}
                        brandName="CapitalVenture"
                    />
                </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="Investment Insights & Market Analysis"
                            description="Stay informed with our latest research, market trends, and investment strategies from CapitalVenture's expert team."
                            tag="Insights"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            carouselMode="buttons"
                            animationType="slide-up"
                            tagAnimation="slide-up"
                            buttonAnimation="slide-up"
                            buttons={[
                                { text: "View All Articles", href: "#" },
                                { text: "Subscribe", href: "#" }
                            ]}
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBase
                        logoText="CapitalVenture"
                        copyrightText="© 2025 CapitalVenture Partners. All rights reserved."
                        columns={[
                            {
                                title: "Company",                                items: [
                                    { label: "Home", href: "/" },
                                    { label: "About Us", href: "/about" },
                                    { label: "Our Portfolio", href: "/portfolio" },
                                    { label: "Contact", href: "/contact" }
                                ]
                            },
                            {
                                title: "Resources",                                items: [
                                    { label: "Investment Process", href: "#" },
                                    { label: "Market Insights", href: "#" },
                                    { label: "News & Updates", href: "#" },
                                    { label: "Careers", href: "#" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms of Service", href: "#" },
                                    { label: "SEC Disclosures", href: "#" },
                                    { label: "Contact Us", href: "#contact" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}