'use client'; import { Queries } from '@/api/queries'; import Loader from '@/components/Loader'; import LotteryWinnersSection from '@/components/lottery/LotteryWinnersSection'; import RollingCounter from '@/components/lottery/RollingCounter/RollingCounter'; import LotteryCountDown from '@/components/lottery/countDown/LotteryCountDown'; import LotteryCountDownAllert from '@/components/lottery/countDown/countDownAllert/LotteryCountDownAllert'; import LotteryForm from '@/components/lottery/form/LotteryForm'; import LotteryRulesSection from '@/components/lottery/rules/LotteryRulesSection'; import { ILottery } from '@/models/lottery/lottery.model'; import Image from 'next/image'; import { useEffect, useState } from 'react'; const page = () => { const [isLoading, setIsLoading] = useState(true); const [data, setData] = useState(); const [lotteryStatus, setLotteryStatus] = useState<'not-started' | 'started' | 'ended'>( 'not-started', ); useEffect(() => { Queries.getLottery() .then((res) => { setData(res); }) .finally(() => setIsLoading(false)); }, []); // if (isLoading) { // return ( //
// //
// ); // } return (
{data && (
{data.data.title && (

{data.data.title}

)} {data.data.description && (

{data.data.description}

)} {data.data.sms_code && (
SMS-kod: {data.data.sms_code}
)}
{data.data.image && (
banner
)}
)}
{lotteryStatus === 'not-started' && (
)}
); }; export default page;