mirror of
https://github.com/ershisan99/www.git
synced 2025-12-17 05:19:23 +00:00
add auth buttons
This commit is contained in:
@@ -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')
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user