guest book added
This commit is contained in:
@@ -12,7 +12,7 @@ export default async function EventsPage() {
|
||||
<div>
|
||||
{allEvents.length == 0 ? (
|
||||
<>
|
||||
You don't have any events yet. <Link href={'/events/create'} className='underline'>Create One!</Link>
|
||||
You don't have any events yet. <Link href={'/events/create'} className='underline'>Create One!</Link>
|
||||
</>
|
||||
) : (
|
||||
<table className='table-auto w-full'>
|
||||
|
||||
13
app/(auth)/guest-book/page.tsx
Normal file
13
app/(auth)/guest-book/page.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { authOptions } from '@/app/api/auth/[...nextauth]/route'
|
||||
import { queries } from '@/lib/queries'
|
||||
import { getServerSession } from 'next-auth'
|
||||
import GuestBookPageClient from '@/components/GuestBookPageClient'
|
||||
|
||||
export default async function GuestBookPage() {
|
||||
const session = await getServerSession(authOptions)
|
||||
if (!session?.user) return <p className='text-center mt-10'>Unauthorized</p>
|
||||
|
||||
const entries = await queries.fetchGuestBookEntries()
|
||||
|
||||
return <GuestBookPageClient entries={entries} />
|
||||
}
|
||||
Reference in New Issue
Block a user