Files
marmarislocal/app/[locale]/admin/blog/[id]/page.tsx
T

40 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { mockDb } from '@/lib/mockDb'
import BlogPostForm from './BlogPostForm'
import { notFound } from 'next/navigation'
interface Props {
params: Promise<{ locale: string; id: string }>
}
export default async function AdminBlogPostEditPage({ params }: Props) {
const { locale, id } = await params
let post = null
if (id !== 'new') {
post = await mockDb.getBlogPostById(id)
if (!post) {
notFound()
}
}
return (
<div className="space-y-6 max-w-4xl">
<div>
<h2 className="text-3xl font-heading font-extrabold text-pine lowercase">
{id === 'new' ? 'yeni yazı ekle' : 'yazıyı düzenle'}
</h2>
<p className="text-ink/65 text-xs font-medium mt-1">
{id === 'new'
? 'Yeni bir blog yazısı oluşturun.'
: 'Mevcut blog yazısı bilgilerini güncelleyin.'}
</p>
</div>
<div className="bg-paper border border-pine/8 rounded-3xl shadow-sm p-6 sm:p-8">
<BlogPostForm post={post} />
</div>
</div>
)
}