swiched to client render
This commit is contained in:
parent
3a69358445
commit
87771711e2
|
|
@ -1,20 +1,24 @@
|
||||||
|
"use client";
|
||||||
import LotteryHeader from "@/components/lottery/LotteryHeader";
|
import LotteryHeader from "@/components/lottery/LotteryHeader";
|
||||||
import LotteryRulesSection from "@/components/lottery/rules/LotteryRulesSection";
|
import LotteryRulesSection from "@/components/lottery/rules/LotteryRulesSection";
|
||||||
import LotteryCountDown from "@/components/lottery/countDown/LotteryCountDown";
|
import LotteryCountDown from "@/components/lottery/countDown/LotteryCountDown";
|
||||||
import { getTossData } from "@/api/queries";
|
import { getTossData } from "@/api/queries";
|
||||||
import { getLotteryStatus } from "@/lib/actions";
|
import { getLotteryStatus } from "@/lib/actions";
|
||||||
import LotteryWinners from "../lottery/LotteryWinners";
|
import LotteryWinners from "../lottery/LotteryWinners";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
const TossPage = async ({
|
const TossPage = ({ type, id }: { type: "bije" | "cekilis"; id: string }) => {
|
||||||
type,
|
const [tossData, setTossData] = useState<any>();
|
||||||
id,
|
|
||||||
}: {
|
|
||||||
type: "bije" | "cekilis";
|
|
||||||
id: string;
|
|
||||||
}) => {
|
|
||||||
const tossData = await getTossData({ type, id });
|
|
||||||
|
|
||||||
const status = await getLotteryStatus(
|
useEffect(() => {
|
||||||
|
const getData = async () => {
|
||||||
|
setTossData(await getTossData({ type, id }));
|
||||||
|
};
|
||||||
|
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const status = getLotteryStatus(
|
||||||
tossData?.data?.start_time,
|
tossData?.data?.start_time,
|
||||||
tossData?.data?.end_time
|
tossData?.data?.end_time
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue