"use client"; // mobx react lite import { observer } from "mobx-react-lite"; import { useRouter } from "next/router"; 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"; import { useMobxStore } from "@/lib/mobx/store-provider"; // components // interfaces import { RootStore } from "@/store/root"; import { IIssue } from "types/issue"; export const IssueKanBanBlock = observer(({ issue }: { issue: IIssue }) => { const { project: projectStore, issueDetails: issueDetailStore }: RootStore = useMobxStore(); // router const router = useRouter(); const { workspace_slug, project_slug, board, priorities, states, labels } = router.query as { workspace_slug: string; project_slug: string; board: string; priorities: string; states: string; labels: string; }; const handleBlockClick = () => { issueDetailStore.setPeekId(issue.id); const params: any = { board: board, peekId: issue.id }; if (states && states.length > 0) params.states = states; if (priorities && priorities.length > 0) params.priorities = priorities; if (labels && labels.length > 0) params.labels = labels; router.push( { pathname: `/${workspace_slug}/${project_slug}`, query: { ...params }, }, undefined, { shallow: true } ); }; return (
{/* id */}
{projectStore?.project?.identifier}-{issue?.sequence_id}
{/* name */}
{issue.name}
{/* priority */} {issue?.priority && (
)} {/* state */} {issue?.state_detail && (
)} {/* due date */} {issue?.target_date && (
)}
); });