plane/web/components/issues/issue-detail/links/links.tsx
sriram veeraghanta 3d09a69d58
fix: eslint issues and reconfiguring (#3891)
* fix: eslint fixes

---------

Co-authored-by: gurusainath <gurusainath007@gmail.com>
2024-03-06 18:39:14 +05:30

46 lines
1.1 KiB
TypeScript

import { FC } from "react";
import { observer } from "mobx-react-lite";
// computed
import { useIssueDetail, useUser } from "hooks/store";
import { IssueLinkDetail } from "./link-detail";
// hooks
import { TLinkOperations } from "./root";
export type TLinkOperationsModal = Exclude<TLinkOperations, "create">;
export type TIssueLinkList = {
issueId: string;
linkOperations: TLinkOperationsModal;
};
export const IssueLinkList: FC<TIssueLinkList> = observer((props) => {
// props
const { issueId, linkOperations } = props;
// hooks
const {
link: { getLinksByIssueId },
} = useIssueDetail();
const {
membership: { currentProjectRole },
} = useUser();
const issueLinks = getLinksByIssueId(issueId);
if (!issueLinks) return <></>;
return (
<div className="space-y-2">
{issueLinks &&
issueLinks.length > 0 &&
issueLinks.map((linkId) => (
<IssueLinkDetail
key={linkId}
linkId={linkId}
linkOperations={linkOperations}
isNotAllowed={currentProjectRole === 5 || currentProjectRole === 10}
/>
))}
</div>
);
});