import LotteryHeader from "@/components/lottery/LotteryHeader"; import LotteryRulesSection from "@/components/lottery/rules/LotteryRulesSection"; import LotteryCountDown from "@/components/lottery/countDown/LotteryCountDown"; import Link from "next/link"; import { authenticateLottery } from "@/api"; import { redirect } from "next/navigation"; import { cookies } from "next/headers"; import { getLotteryStatus } from "@/lib/actions"; import LotteryWinners from "./LotteryWinners"; async function getData() { const cookieStore = await cookies(); const phone = cookieStore.get("phoneNumber"); const key = cookieStore.get("key"); if (phone?.value && key?.value) { const res = await authenticateLottery(phone.value, key.value); return res; } else { redirect("/lottery/auth"); } } const LotteryMain = async () => { const lotteryData = await getData(); const status = await getLotteryStatus( lotteryData?.data.start_time, lotteryData?.data.end_time ); return lotteryData?.errorMessage ? (