'use client';

import AdminSidebar from './AdminSidebar';
import { useState } from 'react';
import AdminHeader from './AdminHeader';

export default function AdminPagesLayout({ children, user, onLogout, appName, enabledModules, navigationSections }) {
  const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);

  return (
    <div className="flex h-screen overflow-hidden bg-white dark:bg-black font-ibm-plex-sans">
      <AdminSidebar
        isMobileMenuOpen={isMobileMenuOpen}
        setIsMobileMenuOpen={setIsMobileMenuOpen}
        appName={appName}
        enabledModules={enabledModules}
        navigationSections={navigationSections}
      />
      <div className="flex-1 flex flex-col min-w-0">
        <AdminHeader isMobileMenuOpen={isMobileMenuOpen} setIsMobileMenuOpen={setIsMobileMenuOpen} user={user} onLogout={onLogout} appName={appName} navigationSections={navigationSections} />
        <main className="flex-1 overflow-y-auto bg-neutral-50 dark:bg-black">
          <div className="px-8 py-7 pb-32 max-w-[1920px] mx-auto">
            {children}
          </div>
        </main>
      </div>
    </div>
  );
}
