"use client";

import { useAuth } from "@/hooks/use-auth";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ROLES } from "@/lib/constants";
import Link from "next/link";

export default function AdminPage() {
  const { user } = useAuth();

  return (
    <div className="space-y-6">
      <div>
        <h1 className="text-2xl font-bold">管理后台</h1>
        <p className="text-gray-500 mt-1">
          当前角色: {user?.role ? ROLES[user.role] : "-"}
        </p>
      </div>

      <div className="grid grid-cols-1 md:grid-cols-2 gap-6">
        <Link href="/admin/members">
          <Card className="hover:shadow-md transition-shadow cursor-pointer">
            <CardHeader>
              <CardTitle className="text-lg">成员管理</CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-gray-500 text-sm">
                审核注册申请、管理成员状态
              </p>
            </CardContent>
          </Card>
        </Link>

        <Link href="/admin/classes">
          <Card className="hover:shadow-md transition-shadow cursor-pointer">
            <CardHeader>
              <CardTitle className="text-lg">班级管理</CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-gray-500 text-sm">
                创建和管理班级信息
              </p>
            </CardContent>
          </Card>
        </Link>

        <Link href="/admin/modules">
          <Card className="hover:shadow-md transition-shadow cursor-pointer">
            <CardHeader>
              <CardTitle className="text-lg">模块管理</CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-gray-500 text-sm">
                控制班级功能模块的显示
              </p>
            </CardContent>
          </Card>
        </Link>
      </div>
    </div>
  );
}
