basic search working
This commit is contained in:
@@ -1,18 +1,39 @@
|
||||
import { auth } from "@/auth";
|
||||
import { getPayloadSession } from "payload-authjs";
|
||||
import { SignInButton } from "./_components/SignInButton";
|
||||
import { SignOutButton } from "./_components/SignOutButton";
|
||||
import { getPayload } from 'payload'
|
||||
import config from '@payload-config'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import DiplomarbeitSearch from '@/app/(frontend)/_components/DiplomarbeitSearch'
|
||||
|
||||
const payload = await getPayload({ config })
|
||||
|
||||
|
||||
const Page = async () => {
|
||||
const authjsSession = await auth();
|
||||
const payloadSession = await getPayloadSession();
|
||||
|
||||
|
||||
|
||||
|
||||
const media = await payload.find({
|
||||
collection: 'media',
|
||||
})
|
||||
|
||||
return (
|
||||
<main>
|
||||
<div className="bg-red-500 bg-">
|
||||
<h2 className="text-4xl">Mooongo Geiss</h2>
|
||||
<div className="w-full flex justify-center pt-4">
|
||||
<div className="w-1/3 flex flex-col items-center">
|
||||
<h2 className="text-5xl w-auto ">Alle Diplomarbeiten</h2>
|
||||
<DiplomarbeitSearch />
|
||||
</div>
|
||||
</div>
|
||||
{payloadSession ? <SignOutButton /> : <SignInButton />}
|
||||
|
||||
{media.docs.map((med) => (
|
||||
<div key={med.id}>
|
||||
<h2>{med.url}</h2>
|
||||
<p>{med.alt}</p>
|
||||
</div>
|
||||
))}
|
||||
<br />
|
||||
<h3>Auth.js Session</h3>
|
||||
<pre>{JSON.stringify(authjsSession, null, 2)}</pre>
|
||||
|
||||
Reference in New Issue
Block a user