建立檔案
This commit is contained in:
39
components/admin/admin-panel.tsx
Normal file
39
components/admin/admin-panel.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
"use client"
|
||||
|
||||
import { useState } from "react"
|
||||
import { AdminLayout } from "./admin-layout"
|
||||
import { AdminDashboard } from "./dashboard"
|
||||
import { UserManagement } from "./user-management"
|
||||
import { AppManagement } from "./app-management"
|
||||
import { CompetitionManagement } from "./competition-management"
|
||||
import { AnalyticsDashboard } from "./analytics-dashboard"
|
||||
import { SystemSettings } from "./system-settings"
|
||||
|
||||
export function AdminPanel() {
|
||||
const [currentPage, setCurrentPage] = useState("dashboard")
|
||||
|
||||
const renderPage = () => {
|
||||
switch (currentPage) {
|
||||
case "dashboard":
|
||||
return <AdminDashboard />
|
||||
case "users":
|
||||
return <UserManagement />
|
||||
case "apps":
|
||||
return <AppManagement />
|
||||
case "competitions":
|
||||
return <CompetitionManagement />
|
||||
case "analytics":
|
||||
return <AnalyticsDashboard />
|
||||
case "settings":
|
||||
return <SystemSettings />
|
||||
default:
|
||||
return <AdminDashboard />
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<AdminLayout currentPage={currentPage} onPageChange={setCurrentPage}>
|
||||
{renderPage()}
|
||||
</AdminLayout>
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user