"use client";

import ReactLenis from "lenis/react";
import BlogCardOne from "@/components/sections/blog/BlogCardOne";
import FooterSimple from "@/components/sections/footer/FooterSimple";
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="entrance-slide"
            borderRadius="pill"
            contentWidth="mediumSmall"
            sizing="mediumLarge"
            background="circleGradient"
            cardStyle="glass-elevated"
            primaryButtonStyle="diagonal-gradient"
            secondaryButtonStyle="layered"
            headingFontWeight="normal"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleFullscreen
                        brandName="Prestige Hotels"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Rooms", id: "rooms" },
                            { name: "Amenities", id: "amenities" },
                            { name: "About", id: "about" },
                            { name: "Contact", id: "contact" }
                        ]}
                        bottomLeftText="Luxury Hospitality Since 1995"
                        bottomRightText="reservations@prestigehotels.com"
                    />
                </div>

                {isLoading ? (
                    <div className="w-content-width mx-auto py-20 text-center">
                        <p className="text-foreground">Loading posts...</p>
                    </div>
                ) : (
                    <div id="blog" data-section="blog">
                        <BlogCardOne
                            blogs={posts}
                            title="Latest Articles"
                            description="Discover insights and updates from our luxury hospitality experts"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterSimple
                        columns={[
                            {
                                title: "Navigate",                                items: [
                                    { label: "Home", href: "#home" },
                                    { label: "Rooms & Suites", href: "#rooms" },
                                    { label: "Amenities", href: "#amenities" },
                                    { label: "About Us", href: "#about" }
                                ]
                            },
                            {
                                title: "Guest Services",                                items: [
                                    { label: "Reservations", href: "#contact" },
                                    { label: "Contact Us", href: "mailto:reservations@prestigehotels.com" },
                                    { label: "Special Requests", href: "#contact" },
                                    { label: "Concierge", href: "#contact" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Prestige", href: "#about" },
                                    { label: "Careers", href: "#" },
                                    { label: "Press", href: "#" },
                                    { label: "Sustainability", href: "#" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms & Conditions", href: "#" },
                                    { label: "Accessibility", href: "#" }
                                ]
                            }
                        ]}
                        bottomLeftText="© 2025 Prestige Hotels. All rights reserved."
                        bottomRightText="Luxury Hospitality Excellence"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}