Next.js 14 App Router application for managing homophone pun game levels: - Better Auth with Prisma adapter for authentication - MySQL database with Prisma ORM - Level CRUD operations with drag-and-drop reordering - Tencent COS integration for image uploads - shadcn/ui components with Tailwind CSS - TanStack Query for server state management
28 lines
714 B
TypeScript
28 lines
714 B
TypeScript
'use client'
|
|
|
|
import { useSession } from '@/lib/auth-client'
|
|
import { Spinner } from '@/components/ui/spinner'
|
|
|
|
export function Header() {
|
|
const { data: session, isPending } = useSession()
|
|
|
|
if (isPending) {
|
|
return (
|
|
<header className="h-16 border-b bg-white flex items-center justify-center px-6">
|
|
<Spinner size="sm" />
|
|
</header>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<header className="h-16 border-b bg-white flex items-center justify-between px-6">
|
|
<h2 className="text-lg font-semibold">关卡配置管理</h2>
|
|
<div className="flex items-center gap-4">
|
|
<span className="text-sm text-gray-500">
|
|
{session?.user?.email}
|
|
</span>
|
|
</div>
|
|
</header>
|
|
)
|
|
}
|