"use client"; import { FC } from "react"; import { observer } from "mobx-react-lite"; import Link from "next/link"; import { useSearchParams } from "next/navigation"; // components import { IssueBlockDueDate, IssueBlockPriority, IssueBlockState } from "@/components/issues"; // helpers import { queryParamGenerator } from "@/helpers/query-param-generator"; // hooks import { useIssueDetails, usePublish } from "@/hooks/store"; // interfaces import { IIssue } from "@/types/issue"; type Props = { anchor: string; issue: IIssue; params: any; }; export const IssueKanBanBlock: FC = observer((props) => { const { anchor, issue } = props; const searchParams = useSearchParams(); // query params const board = searchParams.get("board"); const state = searchParams.get("state"); const priority = searchParams.get("priority"); const labels = searchParams.get("labels"); // store hooks const { project_details } = usePublish(anchor); const { setPeekId } = useIssueDetails(); const { queryParam } = queryParamGenerator({ board, peekId: issue.id, priority, state, labels }); const handleBlockClick = () => { setPeekId(issue.id); }; return ( {/* id */}
{project_details?.identifier}-{issue?.sequence_id}
{/* name */}
{issue.name}
{/* priority */} {issue?.priority && (
)} {/* state */} {issue?.state_detail && (
)} {/* due date */} {issue?.target_date && (
)}
); });