From d741901afdadfaabb5ae6a6ff4732e3b093ae01b Mon Sep 17 00:00:00 2001 From: andrzej Date: Wed, 26 Jun 2024 18:19:03 +0200 Subject: [PATCH] add createStoryDialog --- src/app/story/create.tsx | 30 ++++++++++++++++++++++++++++++ src/app/story/page.tsx | 19 ++++++++++++++++--- 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 src/app/story/create.tsx diff --git a/src/app/story/create.tsx b/src/app/story/create.tsx new file mode 100644 index 0000000..178056e --- /dev/null +++ b/src/app/story/create.tsx @@ -0,0 +1,30 @@ +"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 }) { + + console.log(genres) + return ( + + + + + + + New story + Create an entry for a new story i.e. a thing you intend to submit for publication. + + + + + + + ) +} + diff --git a/src/app/story/page.tsx b/src/app/story/page.tsx index 0d51848..4d94658 100644 --- a/src/app/story/page.tsx +++ b/src/app/story/page.tsx @@ -1,16 +1,29 @@ import { Story } from "@prisma/client"; import { DataTable } from "app/ui/tables/data-table"; import { columns } from "./columns"; -import { getStoriesWithGenres } from "app/lib/get"; +import { getGenres, getStoriesWithGenres, getPubsWithGenres } from "app/lib/get"; import { Genre } from "@prisma/client"; +import CreateStoryDialog from "./create"; export type StoryWithGenres = Story & { genres: Array } + + + + + export default async function Page() { - const stories: Array = await getStoriesWithGenres() + const genres = await getGenres() + const storiesWithGenres: Array = await getStoriesWithGenres() + const pubsWithGenres = await getPubsWithGenres() + + + return (
- + + +
) }