"use client";

import ReactLenis from "lenis/react";
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
import FooterBase from '@/components/sections/footer/FooterBase';
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="shift-hover"
            defaultTextAnimation="entrance-slide"
            borderRadius="pill"
            contentWidth="mediumLarge"
            sizing="large"
            background="circleGradient"
            cardStyle="solid"
            primaryButtonStyle="gradient"
            secondaryButtonStyle="solid"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleFullscreen
                        brandName="Revv Productions"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Services", id: "services" },
                            { name: "Testimonials", id: "testimonials" },
                            { name: "Contact", id: "contact" }
                        ]}
                        bottomLeftText="Los Angeles, CA"
                        bottomRightText="hello@revvproductions.com"
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardTwo
                            blogs={posts}
                            title="Behind the Lens"
                            description="Stories, insights, and inspiration from the world of cinematic productions"
                            tag="Blog"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            animationType="slide-up"
                            carouselMode="buttons"
                        />
                    )}

                    <FooterBase
                        logoText="Revv Productions"
                        copyrightText="© 2025 Revv Productions. All rights reserved."
                        columns={[
                            {
                                title: "Services",                                items: [
                                    { label: "Aerial Cinematography", href: "#services" },
                                    { label: "Interior Videography", href: "#services" },
                                    { label: "Virtual Tours", href: "#services" },
                                    { label: "Social Media Reels", href: "#services" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "#about" },
                                    { label: "Portfolio", href: "#portfolio" },
                                    { label: "Testimonials", href: "#testimonials" },
                                    { label: "Contact", href: "#contact" }
                                ]
                            },
                            {
                                title: "Connect",                                items: [
                                    { label: "hello@revvproductions.com", href: "mailto:hello@revvproductions.com" },
                                    { label: "(310) 555-REVV", href: "tel:+13105557388" },
                                    { label: "Instagram", href: "https://instagram.com" },
                                    { label: "Vimeo Portfolio", href: "https://vimeo.com" }
                                ]
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}