"use client"; import { FC } from "react"; import { observer } from "mobx-react-lite"; import { useRouter, useSearchParams } from "next/navigation"; // components import { IssueBlockDueDate } from "@/components/issues/board-views/block-due-date"; import { IssueBlockPriority } from "@/components/issues/board-views/block-priority"; import { IssueBlockState } from "@/components/issues/board-views/block-state"; // hooks import { useIssueDetails, useProject } from "@/hooks/store"; // interfaces import { IIssue } from "@/types/issue"; type IssueKanBanBlockProps = { issue: IIssue; workspaceSlug: string; projectId: string; params: any; }; export const IssueKanBanBlock: FC = observer((props) => { const { workspaceSlug, projectId, params, issue } = props; const { board, priority, states, labels } = params; // store const { project } = useProject(); const { setPeekId } = useIssueDetails(); // router const router = useRouter(); const searchParams = useSearchParams(); const handleBlockClick = () => { setPeekId(issue.id); const params: any = { board: board, peekId: issue.id }; if (states && states.length > 0) params.states = states; if (priority && priority.length > 0) params.priority = priority; if (labels && labels.length > 0) params.labels = labels; router.push(`/${workspaceSlug}/${projectId}?${searchParams}`); }; return (
{/* id */}
{project?.identifier}-{issue?.sequence_id}
{/* name */}
{issue.name}
{/* priority */} {issue?.priority && (
)} {/* state */} {issue?.state_detail && (
)} {/* due date */} {issue?.target_date && (
)}
); });