import { useState } from "react";
import { Outlet } from "react-router";
import Sidebar from "../components/sidebar/Sidebar";

export default function DashboardLayout() {
  const [isOpen, setIsOpen] = useState(true);

  return (
    <div className="min-h-screen bg-[#f4f8ff]">
      <Sidebar
        isOpen={isOpen}
        setIsOpen={setIsOpen}
      />

      <main
        className={`
          transition-all duration-300 min-h-screen
          ${isOpen ? "ml-72" : "ml-0"}
        `}
      >
        <Outlet />
      </main>
    </div>
  );
}