2024-06-26 17:32:18 +00:00
|
|
|
"use client"
|
|
|
|
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 } from "@prisma/client";
|
|
|
|
import { createPub } from "app/lib/create";
|
|
|
|
import PubForm from "app/ui/forms/pub";
|
|
|
|
|
|
|
|
export default function CreatePubDialog({ genres }: ComponentProps<"div"> & { genres: Genre[] }) {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<Dialog>
|
|
|
|
<DialogTrigger asChild>
|
2024-06-26 20:52:33 +00:00
|
|
|
<Button>Create new publication</Button>
|
2024-06-26 17:32:18 +00:00
|
|
|
</DialogTrigger>
|
|
|
|
<DialogContent>
|
|
|
|
<DialogHeader>
|
|
|
|
<DialogTitle>New publication</DialogTitle>
|
|
|
|
<DialogDescription>Create an entry for a new publication i.e. a place you intend to submit stories to.</DialogDescription>
|
|
|
|
</DialogHeader>
|
|
|
|
<PubForm createPub={createPub} genres={genres} />
|
|
|
|
<DialogFooter>
|
|
|
|
<Button form="pubform">Submit</Button>
|
|
|
|
</DialogFooter>
|
|
|
|
|
|
|
|
</DialogContent>
|
|
|
|
</Dialog>
|
|
|
|
)
|
|
|
|
}
|