"use client";

import ReactLenis from "lenis/react";
import BlogCardThree from '@/components/sections/blog/BlogCardThree';
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="icon-arrow"
            defaultTextAnimation="entrance-slide"
            borderRadius="soft"
            contentWidth="mediumLarge"
            sizing="medium"
            background="circleGradient"
            cardStyle="soft-shadow"
            primaryButtonStyle="radial-glow"
            secondaryButtonStyle="layered"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleFullscreen
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Rooms", id: "rooms" },
                            { name: "Amenities", id: "amenities" },
                            { name: "About", id: "about" },
                            { name: "Pricing", id: "pricing" },
                            { name: "Contact", id: "contact" }
                        ]}
                        brandName="LuxeStay"
                        bottomLeftText="Luxury Hospitality"
                        bottomRightText="reservations@luxestay.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="Explore our latest insights and stories from the world of luxury hospitality"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            animationType="slide-up"
                            carouselMode="buttons"
                        />
                    )}

                    <FooterMedia
                        imageSrc="https://img.b2bpic.net/free-photo/minimalist-bedroom-with-view_23-2151934207.jpg"
                        imageAlt="LuxeStay Hotel exterior"
                        logoText="LuxeStay"
                        copyrightText="© 2025 LuxeStay Hotels. All rights reserved."
                        columns={[
                            {
                                title: "Accommodations",                                items: [
                                    { label: "Deluxe Rooms", href: "rooms" },
                                    { label: "Executive Suites", href: "rooms" },
                                    { label: "Penthouse Suites", href: "rooms" }
                                ]
                            },
                            {
                                title: "Experience",                                items: [
                                    { label: "Amenities", href: "amenities" },
                                    { label: "Dining", href: "#dining" },
                                    { label: "Spa & Wellness", href: "amenities" },
                                    { label: "Events", href: "#events" }
                                ]
                            },
                            {
                                title: "Information",                                items: [
                                    { label: "About Us", href: "about" },
                                    { label: "Contact", href: "contact" },
                                    { label: "Privacy Policy", href: "#privacy" },
                                    { label: "Terms & Conditions", href: "#terms" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}