Files
ef_front/app/usr/1_dashboard/page.tsx
2025-09-08 18:30:34 +00:00

26 lines
815 B
TypeScript

// app/dashboard/page.tsx (Server Component)
import { auth } from "@/auth";
import { redirect } from "next/navigation";
import DashboardClient from "@/app/components/Dashboard"; // 기존 코드 대부분 이동
export default async function Page() {
const session = await auth();
if (!session) redirect("/");
// 초기 데이터 서버에서 미리 가져오면 더 빠르고 안전 (예시)
// const [channels, contents] = await Promise.all([
// fetch(`${process.env.API_URL}/channels`, { cache: "no-store" }).then(r=>r.json()),
// fetch(`${process.env.API_URL}/contents`, { cache: "no-store" }).then(r=>r.json()),
// ]);
return (
<DashboardClient
// initialChannels={channels}
// initialContents={contents}
user={session.user} // id/email/name 등
/>
);
}