'use client' import { useState, useEffect } from "react" import axios from "axios" import Countdown from '@/components/elements/Countdown' import Layout from "@/components/layout/Layout" import Link from "next/link" export default function Blog() { const [blogs, setBlogs] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { const fetchBlogs = async () => { try { const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3006/api'; const response = await axios.get(`${API_BASE_URL}/blogs`); if (response.data && response.data.success) { setBlogs(response.data.data); } } catch (error) { console.error("Error fetching blogs:", error); } finally { setLoading(false); } }; fetchBlogs(); }, []); return ( <>

Our Blog

Home Our Blog
{/*===== HERO AREA ENDS =======*/} {/*===== BLOG AREA STARTS =======*/}
{loading ? (
Loading...
) : blogs.length === 0 ? (

No blog posts available at the moment.

) : ( blogs.map((blog) => (
{blog.title}
  • {blog.date || 'No Date'} |
  • {blog.author}
{blog.title}
read more
)) )}
{blogs.length > 0 && (
)}
{/*===== BLOG AREA ENDS =======*/} {/*===== CTA AREA STARTS =======*/}
Buy Ticket
  • 30 January 2025 - 6pm to 11:30pm
  • Secret Location In The UK
{/*===== CTA AREA ENDS =======*/} {/*===== CTA AREA STARTS =======*/}
Buy Ticket
  • 30 January 2025 - 6pm to 11:30pm
  • Secret Location In The UK
) }