2025-12-22 09:48:57 +01:00

55 lines
1.8 KiB
TypeScript

import { useState } from 'react'
import Head from 'next/head'
import { useRouter } from 'next/router'
import { ConnectButton } from '@/components/ConnectButton'
import { ArticleEditor } from '@/components/ArticleEditor'
export default function PublishPage() {
const router = useRouter()
const [published, setPublished] = useState(false)
const handlePublishSuccess = (articleId: string) => {
setPublished(true)
// Redirect to home page after a short delay
setTimeout(() => {
router.push('/')
}, 2000)
}
return (
<>
<Head>
<title>Publish Article - Nostr Paywall</title>
<meta name="description" content="Publish a new article with free preview and paid content" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
<main className="min-h-screen bg-gray-50">
<header className="bg-white shadow-sm">
<div className="max-w-4xl mx-auto px-4 py-4 flex justify-between items-center">
<h1 className="text-2xl font-bold text-gray-900">Nostr Paywall</h1>
<ConnectButton />
</div>
</header>
<div className="max-w-4xl mx-auto px-4 py-8">
<div className="mb-6">
<button
onClick={() => router.push('/')}
className="text-blue-600 hover:text-blue-700 text-sm font-medium mb-4"
>
Back to Articles
</button>
<h2 className="text-3xl font-bold">Publish New Article</h2>
<p className="text-gray-600 mt-2">
Create an article with a free preview and paid full content
</p>
</div>
<ArticleEditor onPublishSuccess={handlePublishSuccess} />
</div>
</main>
</>
)
}