"use client" import Link from "next/link" import TunnlLogo from "./tunnl-logo" import UserMenu from "./user-menu" import { authClient } from "@/lib/auth-client"; import { redirect, RedirectType } from 'next/navigation' type UseSessionReturn = ReturnType; type SessionType = UseSessionReturn extends { data: infer D } ? D : never; type SiteHeaderProps = { session?: SessionType; }; export default function SiteHeader({ session }: SiteHeaderProps) { const logout = async () => { await authClient.signOut({ fetchOptions: { onSuccess: () => { redirect('/login', RedirectType.replace) } } }) } return (
tunnl.live
{session ? ( ) : ( <> Sign In
Sign in to save configurations & view history
)}
) }