Files
star-erp/source-code/ERP(A-a)-商品建檔管理/src/App.tsx
2025-12-30 15:03:19 +08:00

38 lines
936 B
TypeScript

import { useState } from "react";
import NavigationSidebar from "./components/NavigationSidebar";
import ProductManagement from "./components/ProductManagement";
import { Toaster } from "./components/ui/sonner";
export default function App() {
const [currentPage, setCurrentPage] = useState("product-management");
const handleNavigate = (path: string) => {
setCurrentPage(path);
};
const renderPage = () => {
switch (currentPage) {
case "product-management":
return <ProductManagement />;
default:
return <ProductManagement />;
}
};
return (
<div className="flex min-h-screen bg-background">
{/* Sidebar Navigation */}
<NavigationSidebar
currentPath={currentPage}
onNavigate={handleNavigate}
/>
{/* Main Content */}
<main className="flex-1 overflow-auto">
{renderPage()}
</main>
<Toaster />
</div>
);
}