"use client";

import ReactLenis from "lenis/react";
import { Facebook, Instagram, Twitter } from "lucide-react";
import BlogCardThree from "@/components/sections/blog/BlogCardThree";
import FooterCard from "@/components/sections/footer/FooterCard";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline";
import { useBlogPosts } from "@/hooks/useBlogPosts";

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

    return (
        <ThemeProvider
            defaultButtonVariant="expand-hover"
            defaultTextAnimation="reveal-blur"
            borderRadius="sharp"
            contentWidth="compact"
            sizing="large"
            background="aurora"
            cardStyle="soft-shadow"
            primaryButtonStyle="primary-glow"
            secondaryButtonStyle="glass"
            headingFontWeight="bold"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarLayoutFloatingInline
                        brandName="PawsHome"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Pets", id: "products" },
                            { name: "How It Works", id: "feature" },
                            { name: "FAQ", id: "faq" }
                        ]}
                        button={{
                            text: "Adopt Now",                            href: "#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">
                        <BlogCardThree
                            blogs={posts}
                            title="Pet Stories & Updates"
                            description="Discover heartwarming stories and important updates from our animal shelter community"
                            tag="Blog"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            animationType="slide-up"
                            carouselMode="buttons"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterCard
                        logoText="PawsHome"
                        copyrightText="© 2025 PawsHome Animal Shelter. Dedicated to animal welfare and adoption."
                        socialLinks={[
                            {
                                icon: Facebook,
                                href: "https://facebook.com/pawshome",                                ariaLabel: "Facebook"
                            },
                            {
                                icon: Instagram,
                                href: "https://instagram.com/pawshome",                                ariaLabel: "Instagram"
                            },
                            {
                                icon: Twitter,
                                href: "https://twitter.com/pawshome",                                ariaLabel: "Twitter"
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}