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

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

    return (
        <ThemeProvider
            defaultButtonVariant="elastic-effect"
            defaultTextAnimation="background-highlight"
            borderRadius="sharp"
            contentWidth="smallMedium"
            sizing="largeSizeMediumTitles"
            background="floatingGradient"
            cardStyle="layered-gradient"
            primaryButtonStyle="diagonal-gradient"
            secondaryButtonStyle="glass"
            headingFontWeight="bold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleApple
                        brandName="StartupHub"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Team", id: "team" },
                            { name: "Features", id: "features" },
                            { 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="Latest Insights from StartupHub"
                            description="Discover actionable strategies, expert insights, and innovative solutions to accelerate your startup journey and drive sustainable growth"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBaseCard
                        logoText="StartupHub"
                        columns={[
                            {
                                title: "Product",                                items: [
                                    { label: "Features", href: "#features" },
                                    { label: "Pricing", href: "#pricing" },
                                    { label: "Portfolio", href: "https://example.com/portfolio" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About", href: "#about" },
                                    { label: "Team", href: "#team" },
                                    { label: "Blog", href: "https://example.com/blog" }
                                ]
                            },
                            {
                                title: "Resources",                                items: [
                                    { label: "Founders Guide", href: "https://example.com/guide" },
                                    { label: "Documentation", href: "https://example.com/docs" },
                                    { label: "Community", href: "https://example.com/community" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "https://example.com/privacy" },
                                    { label: "Terms of Service", href: "https://example.com/terms" },
                                    { label: "Contact", href: "#contact" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 StartupHub. All rights reserved."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}