import React, { useRef } from "react"; import { observer } from "mobx-react-lite"; import { TIssue, IIssueDisplayFilterOptions, IIssueDisplayProperties } from "@plane/types"; // components import { Spinner } from "@plane/ui"; import { SpreadsheetQuickAddIssueForm } from "@/components/issues"; import { useProject } from "@/hooks/store"; import { SpreadsheetTable } from "./spreadsheet-table"; // types //hooks type Props = { displayProperties: IIssueDisplayProperties; displayFilters: IIssueDisplayFilterOptions; handleDisplayFilterUpdate: (data: Partial) => void; issueIds: string[] | undefined; quickActions: ( issue: TIssue, customActionButton?: React.ReactElement, portalElement?: HTMLDivElement | null ) => React.ReactNode; updateIssue: ((projectId: string, issueId: string, data: Partial) => Promise) | undefined; openIssuesListModal?: (() => void) | null; quickAddCallback?: ( workspaceSlug: string, projectId: string, data: TIssue, viewId?: string ) => Promise; viewId?: string; canEditProperties: (projectId: string | undefined) => boolean; enableQuickCreateIssue?: boolean; disableIssueCreation?: boolean; }; export const SpreadsheetView: React.FC = observer((props) => { const { displayProperties, displayFilters, handleDisplayFilterUpdate, issueIds, quickActions, updateIssue, quickAddCallback, viewId, canEditProperties, enableQuickCreateIssue, disableIssueCreation, } = props; // refs const containerRef = useRef(null); const portalRef = useRef(null); const { currentProjectDetails } = useProject(); const isEstimateEnabled: boolean = currentProjectDetails?.estimate !== null; if (!issueIds || issueIds.length === 0) return (
); return (
{enableQuickCreateIssue && !disableIssueCreation && ( )}
); });