"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="shift-hover"
            defaultTextAnimation="background-highlight"
            borderRadius="soft"
            contentWidth="small"
            sizing="mediumLargeSizeMediumTitles"
            background="aurora"
            cardStyle="subtle-shadow"
            primaryButtonStyle="gradient"
            secondaryButtonStyle="glass"
            headingFontWeight="light"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarLayoutFloatingInline
                        brandName="Intercity"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Rooms", id: "rooms" },
                            { name: "Amenities", id: "amenities" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{
                            text: "Book Now",                            href: "https://booking.example.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">
                        <BlogCardTwo
                            blogs={posts}
                            title="Hotel News & Updates"
                            description="Stay informed with the latest news, events, and stories from Intercity Hotel London"
                            textboxLayout="default"
                            useInvertedBackground={false}
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterBaseReveal
                        columns={[
                            {
                                title: "Hotel",                                items: [
                                    { label: "Rooms", href: "rooms" },
                                    { label: "Amenities", href: "amenities" },
                                    { label: "Dining", href: "amenities" },
                                    { label: "Events", href: "contact" }
                                ]
                            },
                            {
                                title: "Guest Services",                                items: [
                                    { label: "Reservations", href: "https://booking.example.com" },
                                    { label: "Concierge", href: "contact" },
                                    { label: "FAQs", href: "#" },
                                    { label: "Loyalty Program", href: "#" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "about" },
                                    { label: "Careers", href: "#" },
                                    { label: "Privacy Policy", href: "#" },
                                    { label: "Terms & Conditions", href: "#" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 Intercity Hotel London. All rights reserved."
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}