// src/app/(admin)/layout.tsx
import React from "react";
import AdminGuard from "@/components/auth/AdminGuard";
import { SideNav } from "@/components/layout/SideNav";
import { TopNav } from "@/components/layout/TopNav";

const AdminLayout = ({ children }: { children: React.ReactNode }) => {
  return (
    <AdminGuard>
      <div className="h-screen flex">
        {/* 왼쪽 사이드바 */}
        <aside className="w-64 h-screen flex-shrink-0 bg-gray-800">
          <SideNav />
        </aside>
        {/* 오른쪽 메인 영역 */}
        <div className="flex-1 flex flex-col">
          {/* 상단 헤더 */}
          <header className="h-16 bg-white border-b">
            <TopNav />
          </header>

          {/* 메인 컨텐츠 영역 */}
          <main className="flex-1 overflow-auto bg-gray-50 p-6">
            {children}
          </main>
        </div>
      </div>
    </AdminGuard>
  );
};

export default AdminLayout;
