"use client";

import ReactLenis from "lenis/react";
import BlogCardOne from "@/components/sections/blog/BlogCardOne";
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, Twitter } from 'lucide-react';

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

    return (
        <ThemeProvider
            defaultButtonVariant="icon-arrow"
            defaultTextAnimation="entrance-slide"
            borderRadius="rounded"
            contentWidth="medium"
            sizing="medium"
            background="none"
            cardStyle="solid"
            primaryButtonStyle="shadow"
            secondaryButtonStyle="solid"
            headingFontWeight="medium"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarLayoutFloatingInline
                        brandName="Luxe Resort"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Amenities", id: "amenities" },
                            { name: "Rooms", id: "rooms" },
                            { 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">
                        <BlogCardOne
                            blogs={posts}
                            title="Resort Stories & Updates"
                            description="Discover the latest news, insights, and stories from Luxe Resort"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterCard
                        logoText="Luxe Resort"
                        copyrightText="© 2025 Luxe Resort. All rights reserved. Crafted for the discerning traveler."
                        socialLinks={[
                            {
                                icon: Instagram,
                                href: "https://instagram.com/luxeresort",                                ariaLabel: "Instagram"
                            },
                            {
                                icon: Facebook,
                                href: "https://facebook.com/luxeresort",                                ariaLabel: "Facebook"
                            },
                            {
                                icon: Twitter,
                                href: "https://twitter.com/luxeresort",                                ariaLabel: "Twitter"
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}