import type { Metadata } from "next";
import "./globals.css";
import { Sidebar } from "@/components/layout/Sidebar";
import { BottomNav } from "@/components/layout/BottomNav";

export const metadata: Metadata = {
  title: "ShopApp",
  description: "一款支持商品浏览、购物车、在线支付和物流追踪的电商应用。",
};

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="zh-CN">
      <body className="bg-gray-50 min-h-screen">
        <div className="flex">
          {/* Desktop Sidebar */}
          <Sidebar items={[{"name":"首页","href":"/home","icon":"🏠"},{"name":"商品入库出库","href":"/products","icon":"📋"},{"name":"库存盘点","href":"/stocktaking","icon":"📅"},{"name":"供应商管理","href":"/suppliers","icon":"✏️"},{"name":"库存预警","href":"/stock_alerts","icon":"📸"}] } projectName="ShopApp" />
          {/* Main Content */}
          <main className="flex-1 lg:pl-64 pb-20 lg:pb-0">
            <div className="max-w-2xl mx-auto px-4 py-6">
              {children}
            </div>
          </main>
        </div>
        {/* Mobile Bottom Nav */}
        <BottomNav items={[{"name":"首页","href":"/home","icon":"🏠"},{"name":"商品入库出库","href":"/products","icon":"📋"},{"name":"库存盘点","href":"/stocktaking","icon":"📅"},{"name":"供应商管理","href":"/suppliers","icon":"✏️"}] } />
      </body>
    </html>
  );
}
