"use client";

import ReactLenis from "lenis/react";
import BlogCardThree from '@/components/sections/blog/BlogCardThree';
import FooterSimple from '@/components/sections/footer/FooterSimple';
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
import { useBlogPosts } from "@/hooks/useBlogPosts";

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

    return (
        <ThemeProvider
            defaultButtonVariant="slide-background"
            defaultTextAnimation="background-highlight"
            borderRadius="sharp"
            contentWidth="small"
            sizing="mediumLargeSizeMediumTitles"
            background="floatingGradient"
            cardStyle="outline"
            primaryButtonStyle="diagonal-gradient"
            secondaryButtonStyle="layered"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleCentered
                        brandName="PawsHome"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Pets", id: "pets" },
                            { name: "About", id: "about" },
                            { name: "Stories", id: "stories" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Adopt Now", href: "contact" }}
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardThree
                            blogs={posts}
                            title="Featured Pet Stories"
                            description="Heartwarming stories from our rescued pets and their forever families"
                            tag="Pet Stories"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    )}

                    <FooterSimple
                        columns={[
                            {
                                title: "Quick Links",                                items: [
                                    { label: "Home", href: "#hero" },
                                    { label: "Available Pets", href: "#pets" },
                                    { label: "About Us", href: "#features" },
                                    { label: "Contact", href: "#contact" }
                                ]
                            },
                            {
                                title: "Adoption",                                items: [
                                    { label: "Adoption Process", href: "#" },
                                    { label: "Browse Pets", href: "#pets" },
                                    { label: "Application", href: "#contact" },
                                    { label: "Success Stories", href: "#testimonials" }
                                ]
                            },
                            {
                                title: "Support",                                items: [
                                    { label: "FAQ", href: "#" },
                                    { label: "Contact Us", href: "#contact" },
                                    { label: "Volunteer", href: "#" },
                                    { label: "Donate", href: "#" }
                                ]
                            },
                            {
                                title: "About",                                items: [
                                    { label: "Our Mission", href: "#" },
                                    { label: "Our Team", href: "#team" },
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms of Service", href: "#" }
                                ]
                            }
                        ]}
                        bottomLeftText="© 2025 PawsHome Pet Shelter. All rights reserved."
                        bottomRightText="Caring for pets, enriching lives."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}
