2023-06-11 00:23:23 +04:00
|
|
|
import { auth } from '@/auth'
|
2023-06-11 15:39:04 +04:00
|
|
|
|
|
|
|
|
import { cn } from '@/lib/utils'
|
2023-06-11 00:23:23 +04:00
|
|
|
import { buttonVariants } from '@/components/ui/button'
|
|
|
|
|
import { GitHub, Separator, Vercel } from '@/components/icons'
|
|
|
|
|
import { Sidebar } from '@/components/sidebar'
|
2023-06-11 15:39:04 +04:00
|
|
|
import { UserMenu } from '@/components/user-menu'
|
2023-06-11 11:14:39 -04:00
|
|
|
import { SidebarList } from './sidebar-list'
|
|
|
|
|
import { Suspense } from 'react'
|
2023-06-11 00:23:23 +04:00
|
|
|
|
|
|
|
|
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">
|
2023-06-11 15:08:59 +04:00
|
|
|
<div className="flex items-center">
|
2023-06-11 00:23:23 +04:00
|
|
|
{/* @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-11 20:47:11 +04:00
|
|
|
<div className="hidden items-center md:flex">
|
|
|
|
|
<Separator className="h-6 w-6 text-muted-foreground/50" />
|
2023-06-11 15:08:59 +04:00
|
|
|
<UserMenu session={session} />
|
|
|
|
|
</div>
|
2023-06-11 00:23:23 +04:00
|
|
|
</div>
|
2023-06-11 15:39:04 +04:00
|
|
|
<div className="flex items-center justify-end space-x-2">
|
2023-06-11 00:23:23 +04:00
|
|
|
<a
|
|
|
|
|
target="_blank"
|
|
|
|
|
href="https://github.com/vercel/nextjs-ai-chatbot/"
|
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
|
className={cn(buttonVariants({ variant: 'outline' }))}
|
|
|
|
|
>
|
2023-06-11 20:47:11 +04:00
|
|
|
<GitHub className="mr-2 h-4 w-4" />
|
2023-06-11 00:23:23 +04:00
|
|
|
<span>GitHub</span>
|
|
|
|
|
</a>
|
|
|
|
|
<a
|
|
|
|
|
href="https://github.com/vercel/nextjs-ai-chatbot/"
|
|
|
|
|
target="_blank"
|
|
|
|
|
className={cn(buttonVariants())}
|
|
|
|
|
>
|
2023-06-11 20:47:11 +04:00
|
|
|
<Vercel className="mr-2 h-4 w-4" />
|
2023-06-11 15:08:59 +04:00
|
|
|
<span className="hidden sm:block">Deploy to Vercel</span>
|
2023-06-11 11:14:39 -04:00
|
|
|
<span className="sm:hidden">Vercel</span>
|
2023-06-11 00:23:23 +04:00
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
)
|
|
|
|
|
}
|