import { useRef } from "react"; import { observer } from "mobx-react"; import { useRouter } from "next/router"; // types import { SPREADSHEET_PROPERTY_DETAILS } from "constants/spreadsheet"; import { useEventTracker } from "hooks/store"; import { IIssueDisplayProperties, TIssue } from "@plane/types"; import { WithDisplayPropertiesHOC } from "../properties/with-display-properties-HOC"; import { EIssueActions } from "../types"; // constants // components type Props = { displayProperties: IIssueDisplayProperties; issueDetail: TIssue; disableUserActions: boolean; property: keyof IIssueDisplayProperties; handleIssues: (issue: TIssue, action: EIssueActions) => Promise; isEstimateEnabled: boolean; }; export const IssueColumn = observer((props: Props) => { const { displayProperties, issueDetail, disableUserActions, property, handleIssues, isEstimateEnabled } = props; // router const router = useRouter(); const tableCellRef = useRef(null); const { captureIssueEvent } = useEventTracker(); const shouldRenderProperty = property === "estimate" ? isEstimateEnabled : true; const { Column } = SPREADSHEET_PROPERTY_DETAILS[property]; return ( shouldRenderProperty} > , updates: any) => handleIssues({ ...issue, ...data }, EIssueActions.UPDATE).then(() => { captureIssueEvent({ eventName: "Issue updated", payload: { ...issue, ...data, element: "Spreadsheet layout", }, updates: updates, path: router.asPath, }); }) } disabled={disableUserActions} onClose={() => { tableCellRef?.current?.focus(); }} /> ); });