import { FC, useEffect } from "react"; import { observer } from "mobx-react"; import Link from "next/link"; import { useRouter } from "next/router"; // icons import { CalendarDays } from "lucide-react"; // hooks import { useInboxIssues, useIssueDetail, useProject } from "hooks/store"; // ui import { Tooltip, PriorityIcon } from "@plane/ui"; // helpers import { renderFormattedDate } from "helpers/date-time.helper"; // components import { InboxIssueStatus } from "components/inbox/inbox-issue-status"; type TInboxIssueListItem = { workspaceSlug: string; projectId: string; inboxId: string; issueId: string; }; export const InboxIssueListItem: FC = observer((props) => { const { workspaceSlug, projectId, inboxId, issueId } = props; // router const router = useRouter(); const { inboxIssueId } = router.query; // hooks const { getProjectById } = useProject(); const { issues: { getInboxIssueByIssueId }, } = useInboxIssues(); const { issue: { getIssueById }, } = useIssueDetail(); const inboxIssueDetail = getInboxIssueByIssueId(inboxId, issueId); const issue = getIssueById(issueId); if (!issue || !inboxIssueDetail) return <>; useEffect(() => { if (issueId === inboxIssueId) { setTimeout(() => { const issueItemCard = document.getElementById(`inbox-issue-list-item-${issueId}`); if (issueItemCard) issueItemCard.scrollIntoView({ behavior: "smooth", block: "center", }); }, 200); } }, [issueId, inboxIssueId]); return ( <>

{getProjectById(issue.project_id)?.identifier}-{issue.sequence_id}

{issue.name}
{renderFormattedDate(issue.created_at ?? "")}
); });