"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 NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import { useBlogPosts } from "@/hooks/useBlogPosts";
import { Github, Linkedin, Twitter, Mail } from 'lucide-react';

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

    return (
        <ThemeProvider
            defaultButtonVariant="directional-hover"
            defaultTextAnimation="background-highlight"
            borderRadius="pill"
            contentWidth="medium"
            sizing="mediumLarge"
            background="circleGradient"
            cardStyle="gradient-bordered"
            primaryButtonStyle="inset-glow"
            secondaryButtonStyle="layered"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleFullscreen
                        brandName="HOF Coral"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Work", id: "features" },
                            { name: "Skills", id: "metrics" },
                            { name: "Contact", id: "contact" }
                        ]}
                        bottomLeftText="Developer & Creator"
                        bottomRightText="hello@hofcoral.dev"
                    />
                </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 Articles"
                            description="Insights and updates from our team"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            animationType="slide-up"
                            carouselMode="buttons"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterCard
                        logoText="HOF CORAL"
                        copyrightText="© 2025 HOF Coral. Building exceptional digital experiences."
                        socialLinks={[
                            { icon: Github, href: "https://github.com", ariaLabel: "GitHub Profile" },
                            { icon: Linkedin, href: "https://linkedin.com", ariaLabel: "LinkedIn Profile" },
                            { icon: Twitter, href: "https://twitter.com", ariaLabel: "Twitter Profile" },
                            { icon: Mail, href: "mailto:hello@hofcoral.dev", ariaLabel: "Email Contact" }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}