31 lines
991 B
TypeScript
31 lines
991 B
TypeScript
|
"use client"
|
||
|
import { createStory } 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 } from "@prisma/client";
|
||
|
import StoryForm from "app/ui/forms/story";
|
||
|
|
||
|
|
||
|
export default function CreateStoryDialog({ genres }: ComponentProps<"div"> & { genres: Array<Genre> }) {
|
||
|
|
||
|
console.log(genres)
|
||
|
return (
|
||
|
<Dialog>
|
||
|
<DialogTrigger asChild>
|
||
|
<Button>Create new Story</Button>
|
||
|
</DialogTrigger>
|
||
|
<DialogContent>
|
||
|
<DialogHeader>
|
||
|
<DialogTitle>New story</DialogTitle>
|
||
|
<DialogDescription>Create an entry for a new story i.e. a thing you intend to submit for publication.</DialogDescription>
|
||
|
</DialogHeader>
|
||
|
<StoryForm createStory={createStory} genres={genres} />
|
||
|
|
||
|
|
||
|
</DialogContent>
|
||
|
</Dialog>
|
||
|
)
|
||
|
}
|
||
|
|