'use client'; import { clsx } from 'clsx/lite'; import SiteGrid from '../components/SiteGrid'; import ThemeSwitcher from '@/site/ThemeSwitcher'; import Link from 'next/link'; import { SHOW_REPO_LINK } from '@/site/config'; import RepoLink from '../components/RepoLink'; import { usePathname } from 'next/navigation'; import { isPathAdmin, isPathSignIn, pathForAdminPhotos } from './paths'; import SubmitButtonWithStatus from '@/components/SubmitButtonWithStatus'; import { signOutAction } from '@/auth/action'; import Spinner from '@/components/Spinner'; import AnimateItems from '@/components/AnimateItems'; export default function FooterClient({ userEmail, }: { userEmail?: string | null | undefined }) { const pathname = usePathname(); const showFooter = !isPathSignIn(pathname); const shouldAnimate = !isPathAdmin(pathname); return (
{isPathAdmin(pathname) ? <> {userEmail === undefined && } {userEmail && <>
{userEmail}
Sign out
} : <> Admin {SHOW_REPO_LINK && } }
] : []} />} /> ); }