"use client";

import ReactLenis from "lenis/react";
import BlogCardOne from "@/components/sections/blog/BlogCardOne";
import FooterBaseCard from "@/components/sections/footer/FooterBaseCard";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarLayoutFloatingOverlay from "@/components/navbar/NavbarLayoutFloatingOverlay/NavbarLayoutFloatingOverlay";
import { useBlogPosts } from "@/hooks/useBlogPosts";

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

    return (
        <ThemeProvider
            defaultButtonVariant="directional-hover"
            defaultTextAnimation="background-highlight"
            borderRadius="soft"
            contentWidth="mediumSmall"
            sizing="largeSmallSizeLargeTitles"
            background="circleGradient"
            cardStyle="soft-shadow"
            primaryButtonStyle="primary-glow"
            secondaryButtonStyle="solid"
            headingFontWeight="light"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarLayoutFloatingOverlay
                        brandName="PawsAdopt"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Animals", id: "animals" },
                            { name: "Adopt", id: "adopt" },
                            { name: "Stories", id: "testimonials" }
                        ]}
                        button={{ text: "Donate Now", href: "contact" }}
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardOne
                            blogs={posts}
                            title="Our Latest Stories"
                            description="Discover heartwarming tales of rescued pets finding their forever homes and the amazing journey of pet adoption"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    )}

                    <FooterBaseCard
                        logoText="PawsAdopt"
                        columns={[
                            {
                                title: "About",                                items: [
                                    { label: "Our Mission", href: "#about" },
                                    { label: "Our Team", href: "#" },
                                    { label: "Success Stories", href: "#testimonials" }
                                ]
                            },
                            {
                                title: "Adoption",                                items: [
                                    { label: "Browse Pets", href: "#animals" },
                                    { label: "Adoption Process", href: "#adopt" },
                                    { label: "FAQ", href: "#faq" }
                                ]
                            },
                            {
                                title: "Get Involved",                                items: [
                                    { label: "Volunteer", href: "#" },
                                    { label: "Donate", href: "#contact" },
                                    { label: "Contact Us", href: "#contact" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms of Service", href: "#" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 PawsAdopt Shelter. All rights reserved. Saving lives, one pet at a time."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}