實作管理者儀表板、刪除不必要說明文件
This commit is contained in:
@@ -39,7 +39,11 @@ interface TopApp {
|
||||
created_at: string
|
||||
}
|
||||
|
||||
export function AdminDashboard() {
|
||||
interface AdminDashboardProps {
|
||||
onPageChange?: (page: string) => void
|
||||
}
|
||||
|
||||
export function AdminDashboard({ onPageChange }: AdminDashboardProps) {
|
||||
const { competitions } = useCompetition()
|
||||
const [stats, setStats] = useState<DashboardStats>({
|
||||
totalUsers: 0,
|
||||
@@ -93,6 +97,12 @@ export function AdminDashboard() {
|
||||
return iconMap[iconName] || Activity
|
||||
}
|
||||
|
||||
const handleQuickAction = (page: string) => {
|
||||
if (onPageChange) {
|
||||
onPageChange(page)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{/* Welcome Section */}
|
||||
@@ -286,15 +296,26 @@ export function AdminDashboard() {
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<Button className="h-20 flex flex-col space-y-2">
|
||||
<Button
|
||||
className="h-20 flex flex-col space-y-2"
|
||||
onClick={() => handleQuickAction('users')}
|
||||
>
|
||||
<Users className="w-6 h-6" />
|
||||
<span>管理用戶</span>
|
||||
</Button>
|
||||
<Button className="h-20 flex flex-col space-y-2 bg-transparent" variant="outline">
|
||||
<Button
|
||||
className="h-20 flex flex-col space-y-2 bg-transparent"
|
||||
variant="outline"
|
||||
onClick={() => handleQuickAction('apps')}
|
||||
>
|
||||
<Bot className="w-6 h-6" />
|
||||
<span>新增應用</span>
|
||||
</Button>
|
||||
<Button className="h-20 flex flex-col space-y-2 bg-transparent" variant="outline">
|
||||
<Button
|
||||
className="h-20 flex flex-col space-y-2 bg-transparent"
|
||||
variant="outline"
|
||||
onClick={() => handleQuickAction('competitions')}
|
||||
>
|
||||
<Trophy className="w-6 h-6" />
|
||||
<span>創建競賽</span>
|
||||
</Button>
|
||||
|
Reference in New Issue
Block a user