"use client";

import ReactLenis from "lenis/react";
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
import FooterLogoEmphasis from '@/components/sections/footer/FooterLogoEmphasis';
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="expand-hover"
            defaultTextAnimation="entrance-slide"
            borderRadius="sharp"
            contentWidth="small"
            sizing="mediumSizeLargeTitles"
            background="floatingGradient"
            cardStyle="gradient-bordered"
            primaryButtonStyle="diagonal-gradient"
            secondaryButtonStyle="layered"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleApple
                        brandName="Big Size"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Shop", id: "products" },
                            { name: "Features", id: "features" },
                            { name: "Testimonials", id: "testimonials" },
                            { name: "Contact", id: "contact" }
                        ]}
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardTwo
                            blogs={posts}
                            title="Big Size Blog"
                            description="Discover the latest trends, insights, and stories from the world of fashion"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    )}

                    <FooterLogoEmphasis
                        logoText="Big Size"
                        columns={[
                            {
                                items: [
                                    { label: "Shop", href: "products" },
                                    { label: "Collections", href: "products" },
                                    { label: "New Arrivals", href: "products" }
                                ]
                            },
                            {
                                items: [
                                    { label: "About", href: "features" },
                                    { label: "Our Story", href: "features" },
                                    { label: "Sustainability", href: "features" }
                                ]
                            },
                            {
                                items: [
                                    { label: "Support", href: "contact" },
                                    { label: "Contact Us", href: "contact" },
                                    { label: "FAQ", href: "contact" }
                                ]
                            },
                            {
                                items: [
                                    { label: "Policies", href: "https://example.com/privacy" },
                                    { label: "Privacy", href: "https://example.com/privacy" },
                                    { label: "Terms", href: "https://example.com/terms" }
                                ]
                            },
                            {
                                items: [
                                    { label: "Follow Us", href: "https://instagram.com" },
                                    { label: "Instagram", href: "https://instagram.com" },
                                    { label: "Facebook", href: "https://facebook.com" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}