"use client";

import ReactLenis from "lenis/react";
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
import FooterCard from '@/components/sections/footer/FooterCard';
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple';
import { useBlogPosts } from "@/hooks/useBlogPosts";
import { Twitter, Linkedin, Github, Mail } from 'lucide-react';

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

    return (
        <ThemeProvider
            defaultButtonVariant="text-shift"
            defaultTextAnimation="entrance-slide"
            borderRadius="sharp"
            contentWidth="mediumLarge"
            sizing="largeSizeMediumTitles"
            background="none"
            cardStyle="glass-depth"
            primaryButtonStyle="primary-glow"
            secondaryButtonStyle="radial-glow"
            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" },
                            { name: "Blog", id: "https://blog.example.com" }
                        ]}
                    />
                </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">
                        <BlogCardTwo
                            blogs={posts}
                            title="Latest Insights & Updates"
                            description="Explore our comprehensive collection of articles, insights, and industry updates from our expert team"
                            tag="Blog"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterCard
                        logoText="StartupHub"
                        copyrightText="© 2025 StartupHub Inc. All rights reserved."
                        socialLinks={[
                            { icon: Twitter, href: "https://twitter.com/startuphub", ariaLabel: "Twitter" },
                            { icon: Linkedin, href: "https://linkedin.com/company/startuphub", ariaLabel: "LinkedIn" },
                            { icon: Github, href: "https://github.com/startuphub", ariaLabel: "GitHub" },
                            { icon: Mail, href: "mailto:hello@startuphub.io", ariaLabel: "Email" }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}