'use client'; import { clsx } from 'clsx/lite'; import SiteGrid from '../components/SiteGrid'; import ThemeSwitcher from '@/app/ThemeSwitcher'; import Link from 'next/link'; import { SHOW_REPO_LINK } from '@/app/config'; import RepoLink from '../components/RepoLink'; import { usePathname } from 'next/navigation'; import { PATH_ADMIN_PHOTOS, isPathAdmin, isPathSignIn } from './paths'; import SubmitButtonWithStatus from '@/components/SubmitButtonWithStatus'; import { signOutAndRedirectAction } from '@/auth/actions'; import Spinner from '@/components/Spinner'; import AnimateItems from '@/components/AnimateItems'; import { useAppState } from '@/state/AppState'; export default function Footer() { const pathname = usePathname(); const { userEmail, setUserEmail } = useAppState(); const showFooter = !isPathSignIn(pathname); const shouldAnimate = !isPathAdmin(pathname); return (
{isPathAdmin(pathname) ? <> {userEmail === undefined && } {userEmail && <>
{userEmail}
signOutAndRedirectAction() .then(() => setUserEmail?.(undefined))}> Sign out
} : <> Admin {SHOW_REPO_LINK && } }
] : []} />} /> ); }