import React, { FC } from 'react'; import { DevidedPagePath } from '@growi/core'; import PagePathHierarchicalLink from './PagePathHierarchicalLink'; import CopyDropdown from './Page/CopyDropdown'; import LinkedPagePath from '../models/linked-page-path'; type Props = { pagePath: string, pageId?: string | null, isSingleLineMode?:boolean, isCompactMode?:boolean, } const PagePathNav: FC = (props: Props) => { const { pageId, pagePath, isSingleLineMode, isCompactMode, } = props; const dPagePath = new DevidedPagePath(pagePath, false, true); let formerLink; let latterLink; // one line if (dPagePath.isRoot || dPagePath.isFormerRoot || isSingleLineMode) { const linkedPagePath = new LinkedPagePath(pagePath); latterLink = ; } // two line else { const linkedPagePathFormer = new LinkedPagePath(dPagePath.former); const linkedPagePathLatter = new LinkedPagePath(dPagePath.latter); formerLink = ; latterLink = ; } const copyDropdownId = `copydropdown${isCompactMode ? '-subnav-compact' : ''}-${pageId}`; const copyDropdownToggleClassName = 'd-block btn-outline-secondary btn-copy border-0 text-muted p-2'; return (
{formerLink}

{latterLink}

{ pageId != null && (
) }
); }; export default PagePathNav;