import { useRouter } from "next/router"; // components import { ListProperties } from "./properties"; // ui import { Spinner, Tooltip } from "@plane/ui"; // types import { IIssue, IIssueDisplayProperties } from "types"; import { EIssueActions } from "../types"; interface IssueBlockProps { columnId: string; issue: IIssue; handleIssues: (issue: IIssue, action: EIssueActions) => void; quickActions: (group_by: string | null, issue: IIssue) => React.ReactNode; displayProperties: IIssueDisplayProperties | undefined; canEditProperties: (projectId: string | undefined) => boolean; } export const IssueBlock: React.FC = (props) => { const { columnId, issue, handleIssues, quickActions, displayProperties, canEditProperties } = props; // router const router = useRouter(); const updateIssue = (group_by: string | null, issueToUpdate: IIssue) => { handleIssues(issueToUpdate, EIssueActions.UPDATE); }; const handleIssuePeekOverview = () => { const { query } = router; router.push({ pathname: router.pathname, query: { ...query, peekIssueId: issue?.id, peekProjectId: issue?.project }, }); }; const canEditIssueProperties = canEditProperties(issue.project); return ( <>
{displayProperties && displayProperties?.key && (
{issue?.project_detail?.identifier}-{issue.sequence_id}
)} {issue?.tempId !== undefined && (
)}
{issue.name}
{!issue?.tempId ? ( <> {quickActions(!columnId && columnId === "null" ? null : columnId, issue)} ) : (
)}
); };