"use client";

import ReactLenis from "lenis/react";
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
import FooterCard from '@/components/sections/footer/FooterCard';
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline';
import { useBlogPosts } from "@/hooks/useBlogPosts";
import { Instagram, Facebook, Linkedin } from 'lucide-react';

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

    return (
        <ThemeProvider
            defaultButtonVariant="expand-hover"
            defaultTextAnimation="reveal-blur"
            borderRadius="pill"
            contentWidth="mediumLarge"
            sizing="mediumLargeSizeLargeTitles"
            background="circleGradient"
            cardStyle="elevated"
            primaryButtonStyle="flat"
            secondaryButtonStyle="layered"
            headingFontWeight="bold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarLayoutFloatingInline
                        brandName="LUSSO ITALIA"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Collections", id: "collections" },
                            { name: "About", id: "about" },
                            { name: "Heritage", id: "heritage" },
                            { name: "Testimonials", id: "testimonials" }
                        ]}
                        button={{ text: "Shop Now", href: "#collections" }}
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardTwo
                            blogs={posts}
                            title="Latest Stories"
                            description="Discover our latest articles about luxury, craftsmanship, and Italian heritage"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    )}

                    <FooterCard
                        logoText="LUSSO ITALIA"
                        copyrightText="© 2025 LUSSO ITALIA. All rights reserved. Crafted in Milan, Italy."
                        socialLinks={[
                            { icon: Instagram, href: "https://instagram.com", ariaLabel: "Follow us on Instagram" },
                            { icon: Facebook, href: "https://facebook.com", ariaLabel: "Follow us on Facebook" },
                            { icon: Linkedin, href: "https://linkedin.com", ariaLabel: "Connect on LinkedIn" }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}