"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="bounce-effect"
            defaultTextAnimation="background-highlight"
            borderRadius="soft"
            contentWidth="smallMedium"
            sizing="largeSizeMediumTitles"
            background="floatingGradient"
            cardStyle="elevated"
            primaryButtonStyle="flat"
            secondaryButtonStyle="solid"
            headingFontWeight="light"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleApple
                        brandName="Aesthetic Grace"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Services", id: "services" },
                            { name: "Gallery", id: "gallery" },
                            { name: "Team", id: "team" },
                            { name: "Contact", id: "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="Beauty Insights"
                            description="Expert tips and insights from our board-certified plastic surgeons"
                            tag="Blog"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            animationType="slide-up"
                            carouselMode="buttons"
                            uniformGridCustomHeightClasses="min-h-[600px]"
                            ariaLabel="Blog section"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBaseReveal
                        columns={[
                            {
                                title: "Services",                                items: [
                                    { label: "Facelift", href: "services" },
                                    { label: "Rhinoplasty", href: "services" },
                                    { label: "Breast Surgery", href: "services" },
                                    { label: "Body Contouring", href: "services" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "about" },
                                    { label: "Our Team", href: "team" },
                                    { label: "Gallery", href: "gallery" },
                                    { label: "Contact", href: "contact" }
                                ]
                            },
                            {
                                title: "Contact",                                items: [
                                    { label: "San Diego, CA", href: "#" },
                                    { label: "(619) 555-1234", href: "tel:+16195551234" },
                                    { label: "info@aestheticgracesd.com", href: "mailto:info@aestheticgracesd.com" },
                                    { label: "Mon - Fri: 9AM - 6PM", href: "#" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 Aesthetic Grace. All rights reserved. Board-Certified Excellence in Cosmetic Surgery."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}