"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 NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import { Instagram, Facebook, Twitter, Linkedin } from 'lucide-react';
import { useBlogPosts } from "@/hooks/useBlogPosts";

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

    return (
        <ThemeProvider
            defaultButtonVariant="hover-magnetic"
            defaultTextAnimation="reveal-blur"
            borderRadius="soft"
            contentWidth="mediumSmall"
            sizing="medium"
            background="floatingGradient"
            cardStyle="gradient-radial"
            primaryButtonStyle="primary-glow"
            secondaryButtonStyle="radial-glow"
            headingFontWeight="normal"
        >
            <ReactLenis root>
                <div id="nav" data-section="nav">
                    <NavbarStyleFullscreen
                        brandName="Tiger"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Products", id: "/shop" },
                            { name: "About", id: "about" },
                            { name: "Collections", id: "/shop" },
                            { name: "Contact", id: "contact" },
                            { name: "Shop", id: "/shop" }
                        ]}
                        bottomLeftText="Premium Cup Collection"
                        bottomRightText="hello@tigercups.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="Tiger Blog"
                            description="Discover the art of coffee and premium cup craftsmanship"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                            textBoxTitleClassName="text-red-600"
                            textBoxDescriptionClassName="text-red-500"
                        />
                    </div>
                )}

                <div id="footer" data-section="footer">
                    <FooterCard
                        logoText="Tiger Cups"
                        copyrightText="© 2025 Tiger Cups. All rights reserved. Crafting excellence, one cup at a time."
                        socialLinks={[
                            {
                                icon: Instagram,
                                href: "https://instagram.com/tigercups",                                ariaLabel: "Tiger Cups Instagram"
                            },
                            {
                                icon: Facebook,
                                href: "https://facebook.com/tigercups",                                ariaLabel: "Tiger Cups Facebook"
                            },
                            {
                                icon: Twitter,
                                href: "https://twitter.com/tigercups",                                ariaLabel: "Tiger Cups Twitter"
                            },
                            {
                                icon: Linkedin,
                                href: "https://linkedin.com/company/tigercups",                                ariaLabel: "Tiger Cups LinkedIn"
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}
