"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="hover-magnetic"
            defaultTextAnimation="background-highlight"
            borderRadius="sharp"
            contentWidth="medium"
            sizing="largeSmallSizeLargeTitles"
            background="none"
            cardStyle="layered-gradient"
            primaryButtonStyle="double-inset"
            secondaryButtonStyle="solid"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleFullscreen
                        brandName="IMPERIA"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Fragrances", id: "fragrances" },
                            { name: "Services", id: "services" },
                            { name: "Contact", id: "contact" }
                        ]}
                        bottomLeftText="Luxury Parfumerie"
                        bottomRightText="hello@imperia.com"
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardThree
                            blogs={posts}
                            title="Featured Articles"
                            description="Discover our curated collection of insights and stories from the world of luxury fragrances"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            animationType="slide-up"
                            carouselMode="buttons"
                        />
                    )}

                    <FooterCard
                        logoText="IMPERIA"
                        copyrightText="© 2025 Imperia Parfumerie. All rights reserved. | Luxury Fragrances Curated with Excellence"
                        socialLinks={[
                            { icon: Instagram, href: "https://instagram.com/imperia", ariaLabel: "Follow us on Instagram" },
                            { icon: Facebook, href: "https://facebook.com/imperia", ariaLabel: "Follow us on Facebook" },
                            { icon: Mail, href: "mailto:hello@imperia.com", ariaLabel: "Send us an email" }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}