mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
3d09a69d58
* fix: eslint fixes --------- Co-authored-by: gurusainath <gurusainath007@gmail.com>
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import { FC } from "react";
|
|
import { observer } from "mobx-react-lite";
|
|
// hooks
|
|
import { useIssueDetail } from "hooks/store";
|
|
// components
|
|
import { IssueAttachmentsDetail } from "./attachment-detail";
|
|
// types
|
|
import { TAttachmentOperations } from "./root";
|
|
|
|
type TAttachmentOperationsRemoveModal = Exclude<TAttachmentOperations, "create">;
|
|
|
|
type TIssueAttachmentsList = {
|
|
issueId: string;
|
|
handleAttachmentOperations: TAttachmentOperationsRemoveModal;
|
|
disabled?: boolean;
|
|
};
|
|
|
|
export const IssueAttachmentsList: FC<TIssueAttachmentsList> = observer((props) => {
|
|
const { issueId, handleAttachmentOperations, disabled } = props;
|
|
// store hooks
|
|
const {
|
|
attachment: { getAttachmentsByIssueId },
|
|
} = useIssueDetail();
|
|
|
|
const issueAttachments = getAttachmentsByIssueId(issueId);
|
|
|
|
if (!issueAttachments) return <></>;
|
|
|
|
return (
|
|
<>
|
|
{issueAttachments &&
|
|
issueAttachments.length > 0 &&
|
|
issueAttachments.map((attachmentId) => (
|
|
<IssueAttachmentsDetail
|
|
key={attachmentId}
|
|
attachmentId={attachmentId}
|
|
disabled={disabled}
|
|
handleAttachmentOperations={handleAttachmentOperations}
|
|
/>
|
|
))}
|
|
</>
|
|
);
|
|
});
|