"use client";

import ReactLenis from "lenis/react";
import BlogCardTwo from "@/components/sections/blog/BlogCardTwo";
import FooterSimple from "@/components/sections/footer/FooterSimple";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline";
import { useBlogPosts } from "@/hooks/useBlogPosts";
import { Video } from "lucide-react";

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

    return (
        <ThemeProvider
            defaultButtonVariant="text-shift"
            defaultTextAnimation="entrance-slide"
            borderRadius="soft"
            contentWidth="compact"
            sizing="largeSmallSizeMediumTitles"
            background="none"
            cardStyle="layered-gradient"
            primaryButtonStyle="flat"
            secondaryButtonStyle="solid"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarLayoutFloatingInline
                        brandName="Cinematic Estates"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Services", id: "features" },
                            { name: "Portfolio", id: "blog" },
                            { name: "About", id: "about" },
                            { name: "Testimonials", id: "testimonial" }
                        ]}
                        button={{ text: "Get Started", href: "contact" }}
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardTwo
                            blogs={posts}
                            title="Featured Projects"
                            description="Explore our latest cinematic real estate productions showcasing stunning properties through professional videography"
                            tag="Portfolio"
                            tagIcon={Video}
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            buttons={[
                                { text: "View All Projects", href: "#projects" },
                                { text: "Contact Us", href: "#contact" }
                            ]}
                        />
                    )}

                    <FooterSimple
                        columns={[
                            {
                                title: "Services",                                items: [
                                    { label: "Drone Cinematography", href: "#services" },
                                    { label: "4K & 8K Production", href: "#services" },
                                    { label: "Post Production", href: "#services" },
                                    { label: "Virtual Tours", href: "#services" }
                                ]
                            },
                            {
                                title: "Portfolio",                                items: [
                                    { label: "Featured Projects", href: "#blog" },
                                    { label: "Case Studies", href: "#testimonial" },
                                    { label: "Recent Work", href: "#blog" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "#about" },
                                    { label: "Our Team", href: "#about" },
                                    { label: "Contact", href: "#contact" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "#privacy" },
                                    { label: "Terms of Service", href: "#terms" }
                                ]
                            }
                        ]}
                        bottomLeftText="© 2025 Cinematic Estates. All rights reserved."
                        bottomRightText="Boutique Real Estate Videography"
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}