'use client'; import IconFacebookCircle from '@/components/icon/icon-facebook-circle'; import IconGoogle from '@/components/icon/icon-google'; import IconInstagram from '@/components/icon/icon-instagram'; import IconTwitter from '@/components/icon/icon-twitter'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import React, { useEffect, useState } from 'react'; const ComponentsPagesComingSoonForm = () => { const [demo1, setDemo1] = useState({ days: null, hours: null, minutes: null, seconds: null, }); const [timer1, setTimer1] = useState(null); const setTimerDemo1 = () => { const date = new Date(); date.setFullYear(date.getFullYear() + 1); const countDownDate = date.getTime(); let updatedValue: any = {}; setTimer1( setInterval(() => { const now = new Date().getTime(); const distance = countDownDate - now; updatedValue.days = Math.floor(distance / (1000 * 60 * 60 * 24)); updatedValue.hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); updatedValue.minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); updatedValue.seconds = Math.floor((distance % (1000 * 60)) / 1000); setDemo1((demo1: any) => ({ ...demo1, ...updatedValue, })); if (distance < 0) { clearInterval(timer1); } }, 1000) ); }; useEffect(() => { setTimerDemo1(); return () => { clearInterval(timer1); }; }, []); const router = useRouter(); return ( <>
{demo1.days}
:
{demo1.hours}
:
{demo1.minutes}
:
{demo1.seconds}

Subscribe to get notified!

); }; export default ComponentsPagesComingSoonForm;