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


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


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