2024-06-26 17:55:18 +00:00
|
|
|
|
|
|
|
"use client"
|
|
|
|
import { createStory, createSub } from "app/lib/create"
|
|
|
|
import { Dialog, DialogHeader, DialogTrigger, DialogContent, DialogClose, DialogTitle, DialogFooter, DialogDescription } from "@/components/ui/dialog";
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
import { ComponentProps } from "react";
|
|
|
|
import { Genre, Pub, Story } from "@prisma/client";
|
|
|
|
import StoryForm from "app/ui/forms/story";
|
|
|
|
import SubmissionForm from "app/ui/forms/sub";
|
|
|
|
import { getPubs, getResponses, getStories } from "app/lib/get";
|
|
|
|
|
|
|
|
|
|
|
|
export default function CreateSubmissionDialog({ stories, pubs, responses }: ComponentProps<"div"> & { stories: Story[], pubs: Pub[], responses: Response[] }) {
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Dialog>
|
|
|
|
<DialogTrigger asChild>
|
2024-06-26 19:41:52 +00:00
|
|
|
<Button>Create new submission</Button>
|
2024-06-26 17:55:18 +00:00
|
|
|
</DialogTrigger>
|
|
|
|
<DialogContent>
|
|
|
|
<DialogHeader>
|
2024-06-26 19:41:52 +00:00
|
|
|
<DialogTitle>New submission</DialogTitle>
|
2024-06-26 17:55:18 +00:00
|
|
|
<DialogDescription>Create an entry for a new story i.e. a thing you intend to submit for publication.</DialogDescription>
|
|
|
|
</DialogHeader>
|
|
|
|
<SubmissionForm createSub={createSub} pubs={pubs} responses={responses} stories={stories} />
|
|
|
|
<DialogFooter>
|
|
|
|
<Button form="subform">Submit</Button>
|
|
|
|
</DialogFooter>
|
|
|
|
|
|
|
|
</DialogContent>
|
|
|
|
</Dialog>
|
|
|
|
)
|
|
|
|
}
|