"use server"
import { getPubs, getResponses, getStories } from "app/lib/get";
import SubmissionForm from "app/ui/forms/sub";
import { SelectForm } from "app/ui/forms/selectDemo";
import prisma from "app/lib/db";

export default async function Page() {
	const stories = await getStories()
	const pubs = await getPubs()
	const responses = await getResponses()
	async function createSub(data) {
		"use server"
		const res = await prisma.sub.create({ data })
		console.log(res)
	}
	return <SubmissionForm stories={stories} pubs={pubs} responses={responses} createSub={createSub} />
}
