import { useEffect, useCallback } from 'react' import { useRouter } from 'next/router' import Head from 'next/head' import { ConnectButton } from '@/components/ConnectButton' import { AuthorPresentationEditor } from '@/components/AuthorPresentationEditor' import { useNostrConnect } from '@/hooks/useNostrConnect' import { useAuthorPresentation } from '@/hooks/useAuthorPresentation' import { t } from '@/lib/i18n' function usePresentationRedirect(connected: boolean, pubkey: string | null) { const router = useRouter() const { checkPresentationExists } = useAuthorPresentation(pubkey ?? null) const redirectIfExists = useCallback(async () => { if (!connected || !pubkey) { return } const presentation = await checkPresentationExists() if (presentation) { await router.push('/') } }, [checkPresentationExists, connected, pubkey, router]) useEffect(() => { void redirectIfExists() }, [redirectIfExists]) } function PresentationLayout() { return ( <> {t('presentation.title')} - {t('home.title')}

zapwall.fr

{t('presentation.title')}

{t('presentation.description')}

) } export default function PresentationPage() { const { connected, pubkey } = useNostrConnect() usePresentationRedirect(connected, pubkey) return }