import React from "react";
import { LayoutDashboard } from "lucide-react";
import SidebarLayout from "./SidebarLayout/SidebarLayout";
import TopNavLayout from "./TopNavLayout/TopNavLayout";
import type { NavItem } from "./SidebarLayout/SidebarNav";

export default function AppShell({
  title = "应用管理",
  icon = <LayoutDashboard className="w-5 h-5 text-brand-accent" />,
  userName = "User",
  userRole,
  navItems = [],
  onSignOut,
  children,
}: {
  title?: string;
  icon?: React.ReactNode;
  userName?: string;
  userRole?: string;
  navItems?: NavItem[];
  onSignOut?: () => void;
  children: React.ReactNode;
}) {
  return (
    <SidebarLayout items={navItems}>
      <TopNavLayout title={title} icon={icon} userName={userName} userRole={userRole} onSignOut={onSignOut}>
        {children}
      </TopNavLayout>
    </SidebarLayout>
  );
}
