import { Sidebar } from '@/components/layout/Sidebar';
import { TopBar } from '@/components/layout/TopBar';
import { PageHeaderProvider } from '@/components/layout/PageHeaderContext';

export default function DashboardLayout({ children }: { children: React.ReactNode }) {
  return (
    <PageHeaderProvider>
      <div
        style={{
          display: 'grid',
          gridTemplateColumns: '248px 1fr',
          minHeight: '100vh',
          background: 'var(--bg)',
        }}
      >
        <Sidebar />
        <div style={{ display: 'flex', flexDirection: 'column', minWidth: 0 }}>
          <TopBar />
          <main
            style={{
              flex: 1,
              overflowY: 'auto',
            }}
          >
            {children}
          </main>
        </div>
      </div>
    </PageHeaderProvider>
  );
}
