"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 { Facebook, Instagram, Heart } from 'lucide-react';

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

    return (
        <ThemeProvider
            defaultButtonVariant="hover-bubble"
            defaultTextAnimation="background-highlight"
            borderRadius="soft"
            contentWidth="mediumLarge"
            sizing="mediumLargeSizeLargeTitles"
            background="aurora"
            cardStyle="gradient-bordered"
            primaryButtonStyle="gradient"
            secondaryButtonStyle="glass"
            headingFontWeight="light"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleFullscreen
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Pets", id: "pets" },
                            { name: "About", id: "about" },
                            { name: "Adopt", id: "adopt" },
                            { name: "Contact", id: "contact" }
                        ]}
                        brandName="Paw Haven Shelter"
                        bottomLeftText="Saving Lives, Finding Homes"
                        bottomRightText="hello@pawhavenshelter.org"
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardTwo
                            blogs={posts}
                            title="Paw Haven Stories"
                            description="Read heartwarming stories of rescue, care, and adoption from our shelter community"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    )}

                    <FooterCard
                        logoText="Paw Haven Shelter"
                        copyrightText="© 2025 Paw Haven Shelter | Saving Lives, Finding Homes"
                        socialLinks={[
                            {
                                icon: Facebook,
                                href: "https://facebook.com/pawhavenshelter",                                ariaLabel: "Follow us on Facebook"
                            },
                            {
                                icon: Instagram,
                                href: "https://instagram.com/pawhavenshelter",                                ariaLabel: "Follow us on Instagram"
                            },
                            {
                                icon: Heart,
                                href: "https://donate.pawhavenshelter.org",                                ariaLabel: "Support our mission"
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}