"use client";

import ReactLenis from "lenis/react";
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
import FooterMedia from '@/components/sections/footer/FooterMedia';
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import { useBlogPosts } from "@/hooks/useBlogPosts";

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

    return (
        <ThemeProvider
            defaultButtonVariant="slide-background"
            defaultTextAnimation="background-highlight"
            borderRadius="soft"
            contentWidth="mediumLarge"
            sizing="mediumLarge"
            background="none"
            cardStyle="inset"
            primaryButtonStyle="radial-glow"
            secondaryButtonStyle="solid"
            headingFontWeight="medium"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleFullscreen
                        brandName="Valenok"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Collection", id: "products" },
                            { name: "About", id: "about" },
                            { name: "Testimonials", id: "testimonials" },
                            { name: "Contact", id: "contact" }
                        ]}
                        bottomLeftText="Fashion Forward"
                        bottomRightText="hello@valenok.com"
                    />

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

                    <FooterMedia
                        imageSrc="http://img.b2bpic.net/free-photo/unfocused-background-with-woman-clothing-store_1258-4.jpg"
                        imageAlt="Valenok fashion store"
                        logoText="Valenok"
                        copyrightText="© 2025 Valenok. All rights reserved."
                        columns={[
                            {
                                title: "Shop",                                items: [
                                    { label: "New Arrivals", href: "products" },
                                    { label: "Collections", href: "highlights" },
                                    { label: "Sale", href: "products" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "about" },
                                    { label: "Sustainability", href: "about" },
                                    { label: "Contact", href: "contact" }
                                ]
                            },
                            {
                                title: "Support",                                items: [
                                    { label: "FAQ", href: "#" },
                                    { label: "Shipping Info", href: "#" },
                                    { label: "Returns", href: "#" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}