import { auth } from "@/auth";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";

export default async function DashboardPage() {
  const session = await auth();
  const user = session?.user as any;

  return (
    <div className="space-y-4">
      <h1 className="text-2xl font-bold">欢迎，{user?.name || user?.email}</h1>
      <Card>
        <CardHeader>
          <CardTitle>用户信息</CardTitle>
        </CardHeader>
        <CardContent className="space-y-2 text-sm">
          <p>
            <span className="font-medium">用户名：</span>
            {user?.name}
          </p>
          <p>
            <span className="font-medium">邮箱：</span>
            {user?.email}
          </p>
          <p>
            <span className="font-medium">角色：</span>
            {user?.role}
          </p>
        </CardContent>
      </Card>
    </div>
  );
}
