chatbot-template/components/header.tsx

52 lines
1.8 KiB
TypeScript
Raw Normal View History

2023-06-13 16:02:07 +04:00
import { Suspense } from 'react'
import { auth } from '@/auth'
import { cn } from '@/lib/utils'
import { buttonVariants } from '@/components/ui/button'
import { Sidebar } from '@/components/sidebar'
import { UserMenu } from '@/components/user-menu'
2023-06-13 16:02:07 +04:00
import { SidebarList } from '@/components/sidebar-list'
import { IconGitHub, IconSeparator, IconVercel } from '@/components/ui/icons'
export async function Header() {
const session = await auth()
return (
2023-06-11 20:47:11 +04:00
<header className="sticky top-0 z-50 flex h-16 w-full shrink-0 items-center justify-between border-b bg-gradient-to-b from-background/10 via-background/50 to-background/80 px-4 backdrop-blur-xl">
<div className="flex items-center">
{/* @ts-ignore */}
2023-06-11 11:14:39 -04:00
<Sidebar session={session}>
<Suspense fallback={<div className="flex-1 overflow-auto" />}>
{/* @ts-ignore */}
<SidebarList session={session} />
</Suspense>
</Sidebar>
2023-06-13 18:14:06 +04:00
<div className="flex items-center">
2023-06-13 16:02:07 +04:00
<IconSeparator className="h-6 w-6 text-muted-foreground/50" />
<UserMenu session={session} />
</div>
</div>
<div className="flex items-center justify-end space-x-2">
<a
target="_blank"
href="https://github.com/vercel/nextjs-ai-chatbot/"
rel="noopener noreferrer"
className={cn(buttonVariants({ variant: 'outline' }))}
>
2023-06-13 18:14:06 +04:00
<IconGitHub />
<span className="hidden md:flex ml-2">GitHub</span>
</a>
<a
href="https://github.com/vercel/nextjs-ai-chatbot/"
target="_blank"
className={cn(buttonVariants())}
>
2023-06-13 18:14:06 +04:00
<IconVercel className="mr-2" />
<span className="hidden sm:block">Deploy to Vercel</span>
2023-06-11 23:07:49 +04:00
<span className="sm:hidden">Deploy</span>
</a>
</div>
</header>
)
}