pollo/src/app/room/[id]/page.tsx

28 lines
754 B
TypeScript
Raw Normal View History

2023-09-01 19:43:15 -06:00
import { currentUser } from "@clerk/nextjs";
import Loading from "@/app/_components/Loading";
import VoteUI from "@/app/_components/VoteUI";
2023-08-27 23:57:17 -06:00
2023-09-03 16:04:35 -06:00
export const runtime = "edge";
export const preferredRegion = ["pdx1"];
2023-09-05 18:16:28 -06:00
export const dynamic = "force-dynamic";
export const revalidate = 0;
export const fetchCache = "force-no-store";
2023-04-20 04:20:00 -06:00
2023-09-01 19:43:15 -06:00
export default async function Room() {
const user = await currentUser();
2023-04-20 04:20:00 -06:00
2023-09-01 19:43:15 -06:00
const shapedUser = {
id: user?.id,
firstName: user?.firstName,
lastName: user?.lastName,
imageUrl: user?.imageUrl,
publicMetadata: user?.publicMetadata,
};
2023-08-28 07:49:00 -06:00
2023-04-20 04:20:00 -06:00
return (
2023-08-29 18:14:54 -06:00
<div className="flex flex-col items-center justify-center text-center gap-2">
2023-09-01 19:43:15 -06:00
{user ? <VoteUI user={shapedUser} /> : <Loading />}
2023-08-29 18:14:54 -06:00
</div>
2023-04-20 04:20:00 -06:00
);
2023-09-01 19:43:15 -06:00
}