-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.tsx
31 lines (25 loc) · 848 Bytes
/
page.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import type { Metadata } from "next";
import { redirect } from "next/navigation";
import MyPostList from "#app/profile/(myPosts)/MyPostList.jsx";
import PlatformProfiles from "#app/profile/(platform)/PlatformProfiles.jsx";
import SnipedPostListSection from "#app/profile/(sniped)/SnipedPostListSection.jsx";
import { auth } from "#auth";
import { getProfile } from "#lib/database/users.js";
export const metadata: Metadata = {
title: "내 프로필",
};
export default async function Profile() {
const session = await auth();
const userId = session?.user?.id;
if (!userId) {
return redirect("/");
}
const profile = await getProfile(userId);
return (
<>
<PlatformProfiles profile={profile} />
<SnipedPostListSection profile={profile} className="mt-12" />
<MyPostList className="mt-12" />
</>
);
}