import React, { useState } from 'react'
import Sidebar from './Layouts/Sidebar'
import Header from './Layouts/Header'

interface MainLayoutProps {
  children: React.ReactNode
}

export default function MainLayout({ children }: MainLayoutProps) {
  const [sidebarOpen, setSidebarOpen] = useState(false)

  const toggleSidebar = () => setSidebarOpen(!sidebarOpen)

  return (
    <div className="min-h-screen bg-[#f1f5f9]">
      <Sidebar isOpen={sidebarOpen} onToggle={toggleSidebar} />

      <div className="lg:pl-64 flex flex-col min-h-screen">
        <Header onToggleSidebar={toggleSidebar} />

        <main className="flex-1 p-6">
          {children}
        </main>
      </div>
    </div>
  )
}
