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

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

    return (
        <ThemeProvider
            defaultButtonVariant="shift-hover"
            defaultTextAnimation="reveal-blur"
            borderRadius="sharp"
            contentWidth="mediumLarge"
            sizing="largeSmallSizeMediumTitles"
            background="floatingGradient"
            cardStyle="soft-shadow"
            primaryButtonStyle="primary-glow"
            secondaryButtonStyle="layered"
            headingFontWeight="semibold"
        >
            <ReactLenis root>
                <div className="min-h-screen bg-background">
                    <NavbarStyleApple
                        brandName="Drink with Us"
                        navItems={[
                            { name: "Home", id: "/" },
                            { name: "About", id: "about" },
                            { name: "Menu", id: "products" },
                            { name: "Team", id: "team" },
                            { name: "Contact", id: "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 Coffee Insights"
                            description="Discover brewing techniques, coffee origins, and industry trends from our passionate team"
                            textboxLayout="default"
                            useInvertedBackground="noInvert"
                            carouselMode="buttons"
                            animationType="slide-up"
                            tag="Blog"
                        />
                    )}

                    <FooterCard
                        logoText="Drink with Us"
                        copyrightText="© 2025 Drink with Us Coffee. All rights reserved."
                        socialLinks={[
                            {
                                icon: Instagram,
                                href: "https://instagram.com/drinkwithus",                                ariaLabel: "Instagram"
                            },
                            {
                                icon: Twitter,
                                href: "https://twitter.com/drinkwithus",                                ariaLabel: "Twitter"
                            },
                            {
                                icon: Facebook,
                                href: "https://facebook.com/drinkwithus",                                ariaLabel: "Facebook"
                            },
                            {
                                icon: Linkedin,
                                href: "https://linkedin.com/company/drinkwithus",                                ariaLabel: "LinkedIn"
                            }
                        ]}
                    />
                </div>
            </ReactLenis>
        </ThemeProvider>
    );
}