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

38 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 { 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>
)
}