"use client";

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

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

    return (
        <ThemeProvider
            defaultButtonVariant="bounce-effect"
            defaultTextAnimation="background-highlight"
            borderRadius="rounded"
            contentWidth="mediumSmall"
            sizing="mediumLargeSizeMediumTitles"
            background="noiseDiagonalGradient"
            cardStyle="soft-shadow"
            primaryButtonStyle="primary-glow"
            secondaryButtonStyle="radial-glow"
            headingFontWeight="normal"
        >
            <ReactLenis root>
                <NavbarStyleFullscreen
                    brandName="Go Fast"
                    navItems={[
                        { name: "Home", id: "/" },
                        { name: "About", id: "about" },
                        { name: "Team", id: "team" },
                        { name: "News", id: "news" },
                        { name: "Contact", id: "contact" },
                    ]}
                    bottomLeftText="Youth Football Team"
                    bottomRightText="gofast@example.com"
                />

                {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 Articles"
                        description="Insights and updates from our team"
                        animationType="slide-up"
                        textboxLayout="default"
                        useInvertedBackground={false}
                    />
                )}

                <FooterMedia
                    videoSrc="https://img.b2bpic.net/free-photo/green-grass-sports-field-boundary-line_84443-73902.jpg?_wi=2"
                    videoAriaLabel="Green soccer field texture"
                    logoText="Go Fast"
                    columns={[
                        {
                            title: "Team",                            items: [
                                { label: "About Us", href: "#about" },
                                { label: "Our Squad", href: "#team" },
                                { label: "News & Events", href: "#news" },
                            ],
                        },
                        {
                            title: "Support",                            items: [
                                { label: "FAQs", href: "#faq" },
                                { label: "Contact Us", href: "#contact" },
                                { label: "Privacy Policy", href: "/privacy-policy" },
                            ],
                        },
                    ]}
                    copyrightText="© 2024 Go Fast Football. All rights reserved."
                />
            </ReactLenis>
        </ThemeProvider>
    );
}
