"use client";

import ReactLenis from "lenis/react";
import BlogCardOne from "@/components/sections/blog/BlogCardOne";
import FooterBaseCard from '@/components/sections/footer/FooterBaseCard';
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
import { useBlogPosts } from "@/hooks/useBlogPosts";

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

    return (
        <ThemeProvider
            defaultButtonVariant="hover-bubble"
            defaultTextAnimation="reveal-blur"
            borderRadius="rounded"
            contentWidth="small"
            sizing="largeSmallSizeLargeTitles"
            background="aurora"
            cardStyle="gradient-bordered"
            primaryButtonStyle="double-inset"
            secondaryButtonStyle="solid"
            headingFontWeight="extrabold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleCentered
                        brandName="InClips Media"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Services", id: "features" },
                            { name: "Work", id: "product" },
                            { name: "About", id: "about" },
                            { name: "Testimonials", id: "testimonial" },
                            { name: "Contact", id: "contact" }
                        ]}
                        button={{ text: "Start Project", href: "contact" }}
                    />

                    {isLoading ? (
                        <div className="w-content-width mx-auto py-20 text-center">
                            <p className="text-foreground">Loading posts...</p>
                        </div>
                    ) : (
                        <BlogCardOne
                            blogs={posts}
                            title="Latest Insights"
                            description="Discover our thoughts on creative strategies, digital marketing trends, and brand storytelling"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    )}

                    <FooterBaseCard
                        logoText="InClips Media"
                        columns={[
                            {
                                title: "Services",                                items: [
                                    { label: "Content Creation", href: "#services" },
                                    { label: "Social Media Marketing", href: "#services" },
                                    { label: "Brand Strategy", href: "#services" }
                                ]
                            },
                            {
                                title: "Company",                                items: [
                                    { label: "About Us", href: "#about" },
                                    { label: "Work", href: "#work" },
                                    { label: "Testimonials", href: "#testimonial" }
                                ]
                            },
                            {
                                title: "Connect",                                items: [
                                    { label: "Contact", href: "#contact" },
                                    { label: "LinkedIn", href: "https://linkedin.com" },
                                    { label: "Instagram", href: "https://instagram.com" }
                                ]
                            },
                            {
                                title: "Legal",                                items: [
                                    { label: "Privacy Policy", href: "#privacy" },
                                    { label: "Terms of Service", href: "#terms" },
                                    { label: "Contact Policy", href: "#contact-policy" }
                                ]
                            }
                        ]}
                        copyrightText="© 2025 InClips Media. All rights reserved."
                        onPrivacyClick={null}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}