'use client'; import React, { useEffect, useRef, useState } from 'react'; import { useRouter } from 'next/navigation'; import Header from '../components/custom/header'; import Footer from '../components/custom/footer'; import { Input } from '@/components/ui/input'; import FeaturedEvent from '@/components/custom/FeaturedEvent'; import { Button } from '@/components/ui/button'; import { FlipWords } from '@/components/ui/flip-words'; export default function Home() { const router = useRouter(); const [isClient, setIsClient] = useState(false); const inputRef = useRef(null); useEffect(() => { setIsClient(true); }, []); function searchForEvents() { if (inputRef.current?.value === '') { alert('Please enter a search term.'); return; } if (inputRef.current) { router.replace('/events?q=' + encodeURIComponent(inputRef.current.value)); } } // Handler to check if the Enter key is pressed const handleKeyDown = (event: React.KeyboardEvent) => { if (event.key === 'Enter') { searchForEvents(); } }; const words = [ 'event', 'adventure', 'concert', 'outing', 'journey', 'hackathon', 'conference', 'festival', 'workshop', 'seminar', 'experience', 'activity', 'gathering', ]; return ( <>
{isClient && ( )}
Book your next

Book securely with our leading Blockchain technology.

); }