2024-05-07 07:14:36 +00:00
|
|
|
import { FC } from "react";
|
|
|
|
// types
|
2024-04-15 07:19:14 +00:00
|
|
|
import { TIssue } from "@plane/types";
|
|
|
|
// components
|
2024-05-07 07:14:36 +00:00
|
|
|
import { EModalPosition, EModalWidth, ModalCore } from "@/components/core";
|
2024-04-15 07:19:14 +00:00
|
|
|
import { InboxIssueCreateRoot, InboxIssueEditRoot } from "@/components/inbox/modals/create-edit-modal";
|
|
|
|
|
|
|
|
type TInboxIssueCreateEditModalRoot = {
|
|
|
|
workspaceSlug: string;
|
|
|
|
projectId: string;
|
|
|
|
modalState: boolean;
|
|
|
|
handleModalClose: () => void;
|
|
|
|
issue: Partial<TIssue> | undefined;
|
|
|
|
onSubmit?: () => void;
|
|
|
|
};
|
|
|
|
|
2024-05-07 07:14:36 +00:00
|
|
|
export const InboxIssueCreateEditModalRoot: FC<TInboxIssueCreateEditModalRoot> = (props) => {
|
2024-04-15 07:19:14 +00:00
|
|
|
const { workspaceSlug, projectId, modalState, handleModalClose, issue, onSubmit } = props;
|
|
|
|
|
|
|
|
return (
|
2024-05-07 07:14:36 +00:00
|
|
|
<ModalCore
|
|
|
|
isOpen={modalState}
|
|
|
|
handleClose={handleModalClose}
|
|
|
|
position={EModalPosition.TOP}
|
|
|
|
width={EModalWidth.XXXXL}
|
|
|
|
>
|
|
|
|
{issue && issue?.id ? (
|
|
|
|
<InboxIssueEditRoot
|
|
|
|
workspaceSlug={workspaceSlug}
|
|
|
|
projectId={projectId}
|
|
|
|
issueId={issue.id}
|
|
|
|
issue={issue}
|
|
|
|
handleModalClose={handleModalClose}
|
|
|
|
onSubmit={onSubmit}
|
|
|
|
/>
|
|
|
|
) : (
|
|
|
|
<InboxIssueCreateRoot workspaceSlug={workspaceSlug} projectId={projectId} handleModalClose={handleModalClose} />
|
|
|
|
)}
|
|
|
|
</ModalCore>
|
2024-04-15 07:19:14 +00:00
|
|
|
);
|
2024-05-07 07:14:36 +00:00
|
|
|
};
|