2023-09-24 23:49:24 -06:00
|
|
|
import RoomList from "@/(client)/dashboard/RoomList";
|
2023-05-31 21:49:25 -06:00
|
|
|
import { FaShieldAlt } from "react-icons/fa";
|
2023-07-29 13:18:14 -06:00
|
|
|
import { GiStarFormation } from "react-icons/gi";
|
2023-09-24 23:49:24 -06:00
|
|
|
import { isAdmin, isVIP } from "@/_utils/helpers";
|
2023-09-01 19:43:15 -06:00
|
|
|
import { currentUser } from "@clerk/nextjs";
|
2023-05-31 21:49:25 -06:00
|
|
|
|
2023-09-24 23:49:24 -06:00
|
|
|
export const runtime = "edge";
|
|
|
|
|
2023-09-01 19:43:15 -06:00
|
|
|
export default async function Dashboard() {
|
|
|
|
const user = await currentUser();
|
2023-08-28 12:33:06 -06:00
|
|
|
|
2023-05-31 21:49:25 -06:00
|
|
|
return (
|
2023-08-29 18:14:54 -06:00
|
|
|
<div className="flex flex-col text-center items-center justify-center px-4 py-16 gap-4">
|
2023-09-24 23:49:24 -06:00
|
|
|
<h1 className="flex flex-row flex-wrap text-center justify-center items-center gap-1 text-4xl font-bold">
|
2023-09-06 13:00:00 -06:00
|
|
|
Hi, {user?.firstName ?? user?.username}!{" "}
|
2023-08-14 12:56:22 -06:00
|
|
|
{isAdmin(user?.publicMetadata) && (
|
2023-05-31 21:49:25 -06:00
|
|
|
<FaShieldAlt className="inline-block text-primary" />
|
2023-07-29 13:18:14 -06:00
|
|
|
)}
|
2023-08-14 12:56:22 -06:00
|
|
|
{isVIP(user?.publicMetadata) && (
|
2023-07-29 13:18:14 -06:00
|
|
|
<GiStarFormation className="inline-block text-secondary" />
|
|
|
|
)}
|
2023-05-31 21:49:25 -06:00
|
|
|
</h1>
|
|
|
|
|
2023-09-06 13:00:00 -06:00
|
|
|
<RoomList />
|
2023-09-01 19:43:15 -06:00
|
|
|
</div>
|
2023-05-31 21:49:25 -06:00
|
|
|
);
|
2023-09-01 19:43:15 -06:00
|
|
|
}
|