"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 NavbarStyleCentered from "@/components/navbar/NavbarStyleCentered/NavbarStyleCentered";
import { useBlogPosts } from "@/hooks/useBlogPosts";
import { Coffee } from "lucide-react";

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

    return (
        <ThemeProvider
            defaultButtonVariant="bounce-effect"
            defaultTextAnimation="background-highlight"
            borderRadius="soft"
            contentWidth="mediumLarge"
            sizing="mediumLargeSizeMediumTitles"
            background="aurora"
            cardStyle="subtle-shadow"
            primaryButtonStyle="double-inset"
            secondaryButtonStyle="solid"
            headingFontWeight="extrabold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background" id="nav" data-section="nav">
                    <NavbarStyleCentered
                        brandName="Bean & Brew"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Menu", id: "products" },
                            { name: "About", id: "about" },
                            { name: "Story", id: "metrics" },
                            { name: "Reviews", id: "testimonials" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Order Now", href: "products" }}
                    />

                    {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="Coffee Chronicles"
                                description="Discover stories behind every cup, brewing techniques, and coffee culture insights from Bean & Brew"
                                tag="Coffee Blog"
                                tagIcon={Coffee}
                                textboxLayout="default"
                                useInvertedBackground="noInvert"
                                carouselMode="buttons"
                                animationType="slide-up"
                            />
                        </div>
                    )}

                    <div id="footer" data-section="footer">
                        <FooterBaseCard
                            logoText="Bean & Brew"
                            columns={[
                                {
                                    title: "Coffee",                                    items: [
                                        { label: "Single-Origin Beans", href: "#" },
                                        { label: "House Blends", href: "#" },
                                        { label: "Subscriptions", href: "#" },
                                        { label: "Cold Brew", href: "#" }
                                    ]
                                },
                                {
                                    title: "Cafe",                                    items: [
                                        { label: "Our Story", href: "#about" },
                                        { label: "Locations", href: "#" },
                                        { label: "Hours", href: "#" },
                                        { label: "Events", href: "#" }
                                    ]
                                },
                                {
                                    title: "Community",                                    items: [
                                        { label: "Blog", href: "#" },
                                        { label: "Sustainability", href: "#" },
                                        { label: "Careers", href: "#" },
                                        { label: "Contact", href: "#contact" }
                                    ]
                                },
                                {
                                    title: "Connect",                                    items: [
                                        { label: "Instagram", href: "https://instagram.com" },
                                        { label: "Facebook", href: "https://facebook.com" },
                                        { label: "Twitter", href: "https://twitter.com" },
                                        { label: "Newsletter", href: "#" }
                                    ]
                                }
                            ]}
                            copyrightText="© 2025 Bean & Brew Coffee Co. All rights reserved."
                        />
                    </div>
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}