Files
auto-trade/app/(main)/dashboard/page.tsx
2026-02-06 17:50:35 +09:00

26 lines
848 B
TypeScript

/**
* @file app/(main)/dashboard/page.tsx
* @description 로그인 사용자 전용 대시보드 페이지(Server Component)
*/
import { redirect } from "next/navigation";
import { createClient } from "@/utils/supabase/server";
import { DashboardMain } from "@/features/dashboard/components/dashboard-main";
/**
* 대시보드 페이지
* @returns DashboardMain UI
* @see features/dashboard/components/dashboard-main.tsx 클라이언트 상호작용(검색/시세/차트)은 해당 컴포넌트가 담당합니다.
*/
export default async function DashboardPage() {
// 상태 정의: 서버에서 세션을 먼저 확인해 비로그인 접근을 차단합니다.
const supabase = await createClient();
const {
data: { user },
} = await supabase.auth.getUser();
if (!user) redirect("/login");
return <DashboardMain />;
}