feat: implement dynamic categories, admin category CRUD, fix routing and cleanup
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { mockDb } from '@/lib/mockDb'
|
||||
import { notFound } from 'next/navigation'
|
||||
import EventFormClient from './EventFormClient'
|
||||
|
||||
interface Props {
|
||||
params: Promise<{ locale: string; id: string }>
|
||||
}
|
||||
|
||||
export default async function AdminEventDetailPage({ params }: Props) {
|
||||
const { id } = await params
|
||||
|
||||
let event = null
|
||||
if (id !== 'new') {
|
||||
event = await mockDb.getEventById(id)
|
||||
if (!event) {
|
||||
notFound()
|
||||
}
|
||||
}
|
||||
|
||||
// Get listings so the admin can associate the event with a venue
|
||||
const listings = await mockDb.getListings()
|
||||
|
||||
return (
|
||||
<div className="max-w-3xl space-y-6">
|
||||
<div>
|
||||
<h2 className="text-3xl font-heading font-extrabold text-pine lowercase">
|
||||
{id === 'new' ? 'yeni etkinlik ekle' : 'etkinliği düzenle'}
|
||||
</h2>
|
||||
<p className="text-ink/65 text-xs font-medium mt-1">
|
||||
Etkinlik adını, tarih aralığını ve sponsorluk durumunu belirtin. Kapak görseli eklemeyi unutmayın.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<EventFormClient event={event} listings={listings} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user