feat(admin): 分类管理(分类树增删改移 + 后台页面)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -5,9 +5,10 @@ import ProductList from "./components/ProductList";
|
||||
import ProductDetail from "./components/ProductDetail";
|
||||
import SubmissionsPage from "./components/SubmissionsPage";
|
||||
import ApiKeysPage from "./components/ApiKeysPage";
|
||||
import { Inbox, KeyRound, LogOut, Package } from "lucide-react";
|
||||
import CategoriesPage from "./components/CategoriesPage";
|
||||
import { FolderTree, Inbox, KeyRound, LogOut, Package } from "lucide-react";
|
||||
|
||||
type Tab = "products" | "submissions" | "keys";
|
||||
type Tab = "products" | "submissions" | "categories" | "keys";
|
||||
type View = { name: "list" } | { name: "detail"; id: string };
|
||||
|
||||
export default function App() {
|
||||
@@ -100,6 +101,19 @@ export default function App() {
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
<button
|
||||
onClick={() => {
|
||||
setTab("categories");
|
||||
setView({ name: "list" });
|
||||
}}
|
||||
className={`px-3 py-1.5 rounded-md flex items-center gap-1.5 ${
|
||||
tab === "categories"
|
||||
? "bg-emerald-50 text-emerald-700"
|
||||
: "text-gray-600 hover:bg-gray-100"
|
||||
}`}
|
||||
>
|
||||
<FolderTree className="h-4 w-4" /> 分类管理
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setTab("keys")}
|
||||
className={`px-3 py-1.5 rounded-md flex items-center gap-1.5 ${
|
||||
@@ -125,6 +139,8 @@ export default function App() {
|
||||
<main className="flex-1 overflow-auto p-6">
|
||||
{tab === "keys" ? (
|
||||
<ApiKeysPage />
|
||||
) : tab === "categories" ? (
|
||||
<CategoriesPage />
|
||||
) : tab === "submissions" ? (
|
||||
<SubmissionsPage onPending={setPending} />
|
||||
) : view.name === "list" ? (
|
||||
|
||||
Reference in New Issue
Block a user