// types import { EditorReadOnlyRefApi, EditorRefApi, IMarking } from "@plane/document-editor"; import { OutlineHeading1, OutlineHeading2, OutlineHeading3 } from "./heading-components"; type Props = { editorRef: EditorRefApi | EditorReadOnlyRefApi | null; markings: IMarking[]; setSidePeekVisible?: (sidePeekState: boolean) => void; }; export const PageContentBrowser: React.FC = (props) => { const { editorRef, markings, setSidePeekVisible } = props; const handleOnClick = (marking: IMarking) => { editorRef?.scrollSummary(marking); if (setSidePeekVisible) setSidePeekVisible(false); }; const HeadingComponent: { [key: number]: React.FC<{ marking: IMarking; onClick: () => void }>; } = { 1: OutlineHeading1, 2: OutlineHeading2, 3: OutlineHeading3, }; return (
{markings.length !== 0 ? ( markings.map((marking) => { const Component = HeadingComponent[marking.level]; if (!Component) return null; return ( handleOnClick(marking)} /> ); }) ) : (

Headings will be displayed here for navigation

)}
); };