add auth buttons

This commit is contained in:
2025-06-15 12:37:46 +02:00
parent bedbcfc4b5
commit a06ef798f6

View File

@@ -28,15 +28,15 @@ import {
import { Navbar } from './home/navbar' import { Navbar } from './home/navbar'
import { LargeSearchToggle, SearchToggle } from './search-toggle' import { LargeSearchToggle, SearchToggle } from './search-toggle'
export async function Header({ export function Header({
nav: { enableSearch = true, ...nav } = {}, nav: { enableSearch = true, ...nav } = {},
finalLinks, finalLinks,
themeSwitch, themeSwitch,
}: HomeLayoutProps & { }: HomeLayoutProps & {
finalLinks: LinkItemType[] finalLinks: LinkItemType[]
}) { }) {
const session = await auth() const { data: session, status } = useSession()
const isAuthenticated = session?.user const isAuthenticated = status === 'authenticated'
const navItems = finalLinks.filter((item) => const navItems = finalLinks.filter((item) =>
['nav', 'all'].includes(item.on ?? 'all') ['nav', 'all'].includes(item.on ?? 'all')
) )