2023-08-30 07:19:15 +00:00
|
|
|
import { IssueReactions } from "components/issues/peek-overview";
|
2023-08-31 17:54:03 +00:00
|
|
|
import { TipTapEditor } from "components/tiptap";
|
|
|
|
import { useRouter } from "next/router";
|
2023-08-30 07:19:15 +00:00
|
|
|
// types
|
2023-08-31 19:04:57 +00:00
|
|
|
import { IIssue } from "types/issue";
|
2023-08-30 07:19:15 +00:00
|
|
|
|
|
|
|
type Props = {
|
2023-08-30 18:42:45 +00:00
|
|
|
issueDetails: IIssue;
|
2023-08-30 07:19:15 +00:00
|
|
|
};
|
|
|
|
|
2023-08-31 17:54:03 +00:00
|
|
|
export const PeekOverviewIssueDetails: React.FC<Props> = ({ issueDetails }) => {
|
|
|
|
const router = useRouter();
|
|
|
|
const { workspace_slug } = router.query;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="space-y-2">
|
|
|
|
<h6 className="font-medium text-custom-text-200">
|
|
|
|
{issueDetails.project_detail.identifier}-{issueDetails.sequence_id}
|
|
|
|
</h6>
|
|
|
|
<h4 className="break-words text-2xl font-semibold">{issueDetails.name}</h4>
|
2023-09-01 10:21:34 +00:00
|
|
|
{issueDetails.description_html !== "" && issueDetails.description_html !== "<p></p>" && (
|
|
|
|
<TipTapEditor
|
|
|
|
workspaceSlug={workspace_slug as string}
|
|
|
|
value={
|
|
|
|
!issueDetails.description_html ||
|
|
|
|
issueDetails.description_html === "" ||
|
|
|
|
(typeof issueDetails.description_html === "object" &&
|
|
|
|
Object.keys(issueDetails.description_html).length === 0)
|
|
|
|
? "<p></p>"
|
|
|
|
: issueDetails.description_html
|
|
|
|
}
|
|
|
|
customClassName="p-3 min-h-[50px] shadow-sm"
|
|
|
|
debouncedUpdatesEnabled={false}
|
|
|
|
editable={false}
|
|
|
|
/>
|
|
|
|
)}
|
2023-08-31 17:54:03 +00:00
|
|
|
<IssueReactions />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|