"use client";

import ReactLenis from "lenis/react";
import BlogCardOne from "@/components/sections/blog/BlogCardOne";
import FooterSimple from '@/components/sections/footer/FooterSimple';
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="directional-hover"
            defaultTextAnimation="reveal-blur"
            borderRadius="pill"
            contentWidth="small"
            sizing="mediumLarge"
            background="none"
            cardStyle="solid"
            primaryButtonStyle="inset-glow"
            secondaryButtonStyle="glass"
            headingFontWeight="medium"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleApple
                        brandName="Early Bird Landscaping"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Services", id: "services" },
                            { name: "Before & After", id: "beforeAfter" },
                            { name: "Reviews", id: "reviews" },
                            { name: "About", id: "about" }
                        ]}
                    />
                </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">
                        <BlogCardOne
                            blogs={posts}
                            title="Landscaping Insights & Tips"
                            description="Expert advice and project updates from Early Bird Landscaping"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterSimple
                        columns={[
                            {
                                title: "Services",                                items: [
                                    { label: "Yard Cleanouts", href: "/services" },
                                    { label: "Weed Removal", href: "/services" },
                                    { label: "Trimming & Pruning", href: "/services" },
                                    { label: "Rental Cleanup", href: "/services" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "/about" },
                                    { label: "Before & After", href: "/before-after" },
                                    { label: "Reviews", href: "/reviews" },
                                    { label: "Get a Quote", href: "#quote" }
                                ]
                            },
                            {
                                title: "Contact",                                items: [
                                    { label: "Call Us", href: "tel:+1-555-0123" },
                                    { label: "Text for Quote", href: "sms:+1-555-0123" },
                                    { label: "Email", href: "mailto:info@earlybird-landscaping.com" },
                                    { label: "Hours", href: "#" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms of Service", href: "#" },
                                    { label: "Service Areas", href: "#" }
                                ]
                            }
                        ]}
                        bottomLeftText="© 2025 Early Bird Landscaping. All rights reserved."
                        bottomRightText="Serving your neighborhood with pride."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}