"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="elastic-effect"
            defaultTextAnimation="background-highlight"
            borderRadius="pill"
            contentWidth="small"
            sizing="mediumLarge"
            background="circleGradient"
            cardStyle="inset"
            primaryButtonStyle="primary-glow"
            secondaryButtonStyle="radial-glow"
            headingFontWeight="extrabold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleCentered
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Work", id: "work" },
                            { name: "Writing", id: "writing" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Get in touch", href: "contact" }}
                        brandName="Founder"
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardOne
                            blogs={posts}
                            title="Latest Insights"
                            description="Explore our collection of thoughts, insights, and discoveries in the world of design, technology, and entrepreneurship"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            animationType="slide-up"
                            carouselMode="buttons"
                            tag="Writing"
                            tagIcon={PenTool}
                        />
                    )}

                    <FooterSimple
                        columns={[
                            {
                                title: "Navigate",                                items: [
                                    { label: "Home", href: "#hero" },
                                    { label: "About", href: "#about" },
                                    { label: "Work", href: "#work" },
                                    { label: "Writing", href: "#writing" }
                                ]
                            },
                            {
                                title: "Connect",                                items: [
                                    { label: "LinkedIn", href: "https://linkedin.com" },
                                    { label: "Twitter", href: "https://twitter.com" },
                                    { label: "Email", href: "mailto:contact@example.com" },
                                    { label: "Contact", href: "#contact" }
                                ]
                            },
                            {
                                title: "Resources",                                items: [
                                    { label: "Articles", href: "#writing" },
                                    { label: "Speaking", href: "#" },
                                    { label: "Advising", href: "#" },
                                    { label: "Projects", href: "#" }
                                ]
                            }
                        ]}
                        bottomLeftText="© 2025 Founder. All rights reserved."
                        bottomRightText="Designed with intention and built for clarity."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}