"use client";

import ReactLenis from "lenis/react";
import BlogCardTwo from '@/components/sections/blog/BlogCardTwo';
import FooterCard from '@/components/sections/footer/FooterCard';
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple';
import { useBlogPosts } from "@/hooks/useBlogPosts";
import { Facebook, Twitter, Instagram, Linkedin } from 'lucide-react';

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

    return (
        <ThemeProvider
            defaultButtonVariant="bounce-effect"
            defaultTextAnimation="entrance-slide"
            borderRadius="sharp"
            contentWidth="mediumLarge"
            sizing="medium"
            background="none"
            cardStyle="subtle-shadow"
            primaryButtonStyle="double-inset"
            secondaryButtonStyle="layered"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleApple
                        brandName="iPhone"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "Shop", id: "products" },
                            { name: "Features", id: "features" },
                            { name: "Pricing", id: "pricing" },
                            { name: "Reviews", id: "testimonials" },
                            { name: "Contact", id: "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="Latest iPhone Articles"
                            description="Stay updated with our latest insights and reviews"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                        />
                    )}

                    <FooterCard
                        logoText="iPhone"
                        copyrightText="© 2025 iPhone Store. All rights reserved. Privacy Policy • Terms of Service"
                        socialLinks={[
                            { icon: Facebook, href: "https://facebook.com", ariaLabel: "Facebook" },
                            { icon: Twitter, href: "https://twitter.com", ariaLabel: "Twitter" },
                            { icon: Instagram, href: "https://instagram.com", ariaLabel: "Instagram" },
                            { icon: Linkedin, href: "https://linkedin.com", ariaLabel: "LinkedIn" }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}