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

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

    return (
        <ThemeProvider
            defaultButtonVariant="bounce-effect"
            defaultTextAnimation="entrance-slide"
            borderRadius="sharp"
            contentWidth="small"
            sizing="mediumLargeSizeMediumTitles"
            background="circleGradient"
            cardStyle="layered-gradient"
            primaryButtonStyle="radial-glow"
            secondaryButtonStyle="radial-glow"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleFullscreen
                        brandName="Big Pig"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Products", id: "products" },
                            { name: "About", id: "about" },
                            { name: "Reviews", id: "reviews" },
                            { name: "Contact", id: "contact" }
                        ]}
                        bottomLeftText="Premium Cup Craftsmanship"
                        bottomRightText="hello@bigpigcups.com"
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardOne
                            blogs={posts}
                            title="Crafting Stories & Insights"
                            description="Discover the latest insights from our team about premium cup design, sustainability, and the art of exceptional craftsmanship."
                            tag="Blog"
                            tagIcon={BookOpen}
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    )}

                    <FooterSimple
                        columns={[
                            {
                                title: "Shop",                                items: [
                                    { label: "All Products", href: "#products" },
                                    { label: "New Arrivals", href: "#products" },
                                    { label: "Best Sellers", href: "#products" },
                                    { label: "Gift Sets", href: "#products" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Big Pig", href: "#about" },
                                    { label: "Our Story", href: "#about" },
                                    { label: "Sustainability", href: "#about" },
                                    { label: "Careers", href: "#" }
                                ]
                            },
                            {
                                title: "Support",                                items: [
                                    { label: "Contact Us", href: "#contact" },
                                    { label: "FAQs", href: "#" },
                                    { label: "Shipping Info", href: "#" },
                                    { label: "Returns", href: "#" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms of Service", href: "#" },
                                    { label: "Cookie Policy", href: "#" }
                                ]
                            }
                        ]}
                        bottomLeftText="© 2025 Big Pig Cups. All rights reserved."
                        bottomRightText="Crafted with care • Designed to last"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}