2024-07-19 15:23:07 +00:00
|
|
|
"use client"
|
|
|
|
import { 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 { Pub, Response, Story } from "@prisma/client";
|
2024-07-20 12:07:13 +00:00
|
|
|
import SubmissionForm, { SubForm } from "app/ui/forms/sub";
|
2024-07-19 15:23:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-20 12:07:13 +00:00
|
|
|
export default function EditSubmissionDialog({ stories, pubs, responses, defaults, children }: ComponentProps<"div"> & { stories: Story[], pubs: Pub[], responses: Response[], defaults: SubForm }) {
|
2024-07-19 15:23:07 +00:00
|
|
|
|
|
|
|
return (
|
2024-07-21 17:14:20 +00:00
|
|
|
<>
|
|
|
|
<DialogHeader>
|
|
|
|
<DialogTitle>Edit Submission</DialogTitle>
|
|
|
|
<DialogDescription>Change response status, edit dates etc</DialogDescription>
|
|
|
|
</DialogHeader>
|
|
|
|
<SubmissionForm createSub={createSub} pubs={pubs} responses={responses} stories={stories} defaults={defaults} />
|
|
|
|
<DialogFooter>
|
|
|
|
<DialogClose asChild>
|
|
|
|
</DialogClose>
|
|
|
|
<Button form="subform">Submit</Button>
|
|
|
|
</DialogFooter>
|
|
|
|
</>
|
2024-07-19 15:23:07 +00:00
|
|
|
)
|
|
|
|
}
|