"use client";

import { WorkspaceLeftRail } from "@/components/layout/workspace-left-rail";
import { RightPanel } from "@/components/layout/right-panel";
import { ReactNode, useState } from "react";
import { Toaster } from "sonner";

export default function KeysLayout({
  children,
}: {
  children: ReactNode;
}) {
  const [activeSection, setActiveSection] = useState<string>("keys");

  return (
    <>
      <div className="flex h-screen w-full overflow-hidden bg-background">
        {/* Left Rail - Workspace Navigation */}
        <WorkspaceLeftRail activeSection={activeSection} onSectionChange={setActiveSection} />

        {/* Main Content Area */}
        <main className="flex-1 flex flex-col overflow-hidden">
          {children}
        </main>

        {/* Right Panel - AI Chat */}
        <RightPanel />
      </div>
      
      <Toaster position="top-center" />
    </>
  );
}

