'use client';

import { useState } from 'react';
import AdminSidebar from './AdminSidebar.js';
import AdminTop from './AdminTop.js';

export default function AdminShell({ children, user, onLogout, appName, navigationSections, bottomNavItems }) {
  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}
        navigationSections={navigationSections}
        bottomNavItems={bottomNavItems}
      />
      <div className="flex-1 flex flex-col min-w-0">
        <AdminTop
          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>
  );
}
