import { observer } from "mobx-react"; import { EditorReadOnlyRefApi, EditorRefApi, IMarking } from "@plane/document-editor"; // components import { PageEditorMobileHeaderRoot, PageExtraOptions, PageSummaryPopover, PageToolbar } from "@/components/pages"; // helpers import { cn } from "@/helpers/common.helper"; // hooks import { usePageFilters } from "@/hooks/use-page-filters"; // store import { IPageStore } from "@/store/pages/page.store"; type Props = { editorRef: React.RefObject; readOnlyEditorRef: React.RefObject; handleDuplicatePage: () => void; isSyncing: boolean; markings: IMarking[]; pageStore: IPageStore; projectId: string; sidePeekVisible: boolean; setSidePeekVisible: (sidePeekState: boolean) => void; editorReady: boolean; readOnlyEditorReady: boolean; }; export const PageEditorHeaderRoot: React.FC = observer((props) => { const { editorRef, readOnlyEditorRef, editorReady, markings, readOnlyEditorReady, handleDuplicatePage, isSyncing, pageStore, projectId, sidePeekVisible, setSidePeekVisible, } = props; // derived values const { isContentEditable } = pageStore; // page filters const { isFullWidth } = usePageFilters(); if (!editorRef.current && !readOnlyEditorRef.current) return null; return ( <>
{(editorReady || readOnlyEditorReady) && isContentEditable && editorRef.current && ( )}
); });