feat: add frontend auth shell
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
import { Bell, ChevronRight, UserRound } from 'lucide-react'
|
||||
import { Bell, ChevronRight, LogOut, UserRound } from 'lucide-react'
|
||||
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Separator } from '@/components/ui/separator'
|
||||
import { useAuth } from '@/features/auth/AuthProvider'
|
||||
|
||||
export function AppTopbar() {
|
||||
const { logout, user } = useAuth()
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-20 flex h-14 items-center justify-between border-b border-border bg-surface/95 px-6 backdrop-blur">
|
||||
<div className="flex min-w-0 items-center gap-2 text-sm">
|
||||
@@ -20,7 +23,11 @@ export function AppTopbar() {
|
||||
</Button>
|
||||
<Button variant="ghost" className="gap-2">
|
||||
<UserRound className="size-4" />
|
||||
<span>系统管理员</span>
|
||||
<span>{user?.display_name || user?.username || '当前用户'}</span>
|
||||
</Button>
|
||||
<Button variant="outline" className="gap-2" onClick={() => void logout()}>
|
||||
<LogOut className="size-4" />
|
||||
<span>退出</span>
|
||||
</Button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user