"use client";

import ReactLenis from "lenis/react";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import { useBlogPosts } from "@/hooks/useBlogPosts";

// New component imports based on instructions
import NavbarLayoutFloatingOverlay from '@/components/navbar/NavbarLayoutFloatingOverlay/NavbarLayoutFloatingOverlay';
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
import FooterCard from '@/components/sections/footer/FooterCard';
import { Instagram, Facebook, Pin } from 'lucide-react';

export default function BlogPage() {
    // Preserved logic for fetching posts
    const { posts, isLoading } = useBlogPosts();

    return (
        <ThemeProvider
            defaultButtonVariant="slide-background"
            defaultTextAnimation="background-highlight"
            borderRadius="pill"
            contentWidth="compact"
            sizing="mediumLargeSizeLargeTitles"
            background="grid"
            cardStyle="solid"
            primaryButtonStyle="diagonal-gradient"
            secondaryButtonStyle="radial-glow"
            headingFontWeight="medium"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarLayoutFloatingOverlay
                        brandName="Angelina"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "/#about" },
                            { name: "Services", id: "/#services" },
                            { name: "Shop", id: "/#shop" },
                            { name: "Testimonials", id: "/#testimonials" },
                            { name: "FAQ", id: "/#faq" },
                        ]}
                        button={{ text: "Contact Us", href: "/#contact" }}
                    />
                </div>

                {/* Preserved loading state and posts fetching logic */}
                {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">
                        <BlogCardTwo
                            blogs={posts} // Preserved posts logic
                            // Generated props for BlogCardTwo based on propsSchema
                            title="From Our Blog"
                            description="Explore the latest articles and insights from our team."
                            animationType="slide-up"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            carouselMode="buttons"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterCard
                        logoText="Angelina"
                        copyrightText="© 2025 Angelina Flowers Studio. All rights reserved."
                        socialLinks={[
                            { icon: Instagram, href: "https://instagram.com/angelinaflowers", ariaLabel: "Instagram" },
                            { icon: Facebook, href: "https://facebook.com/angelinaflowers", ariaLabel: "Facebook" },
                            { icon: Pin, href: "https://pinterest.com/angelinaflowers", ariaLabel: "Pinterest" },
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}
