import PortalAuthGuard from '@/components/portal/PortalAuthGuard';
import Sidebar from '@/components/layout/Sidebar';
import TopNav from '@/components/layout/TopNav';
import DashboardContent from '@/components/layout/DashboardContent';

/**
 * Portal layout — wraps all Client Portal pages.
 *
 * Uses the same Sidebar and TopNav as the dashboard layout.
 * The Sidebar filters navigation items by role, so Client_Portal users
 * will only see portal-specific items (Inicio, Analítica, Canciones, Documentos).
 *
 * No RightPanel is rendered for the portal — DashboardContent handles this
 * gracefully since the panel store defaults to closed.
 *
 * PortalAuthGuard ensures only Client_Portal users can access these routes.
 */
export default function PortalLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <PortalAuthGuard>
      <div className="min-h-screen bg-divisi-bg">
        <TopNav />
        <Sidebar />
        <DashboardContent>
          {children}
        </DashboardContent>
      </div>
    </PortalAuthGuard>
  );
}
