"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";
import SubmissionForm, { SubForm } from "app/ui/forms/sub";
import EditSubmissionForm from "app/ui/forms/editSub";



export default function EditSubmissionDialog({ stories, pubs, responses, defaults, children }: ComponentProps<"div"> & { stories: Story[], pubs: Pub[], responses: Response[], defaults: SubForm }) {

  return (
    <>
      <DialogHeader>
        <DialogTitle>Edit Submission</DialogTitle>
        <DialogDescription>Change response status, edit dates etc</DialogDescription>
      </DialogHeader>
      <EditSubmissionForm pubs={pubs} responses={responses} stories={stories} defaults={defaults} />
      <DialogFooter>
        <DialogClose asChild>
        </DialogClose>
        <Button form="subform">Submit</Button>
      </DialogFooter>
    </>
  )
}
