import React from 'react';
import PropTypes from 'prop-types';
import { withTranslation } from 'react-i18next';
import { isTrashPage } from '@commons/util/path-utils';
import DevidedPagePath from '@commons/models/devided-page-path';
import LinkedPagePath from '@commons/models/linked-page-path';
import PagePathHierarchicalLink from '@commons/components/PagePathHierarchicalLink';
import { createSubscribedElement } from '../UnstatedUtils';
import AppContainer from '../../services/AppContainer';
import RevisionPath from '../Page/RevisionPath';
import PageContainer from '../../services/PageContainer';
import TagLabels from '../Page/TagLabels';
import LikeButton from '../LikeButton';
import BookmarkButton from '../BookmarkButton';
import PageCreator from './PageCreator';
import RevisionAuthor from './RevisionAuthor';
const GrowiSubNavigation = (props) => {
const isPageForbidden = document.querySelector('#grw-subnav').getAttribute('data-is-forbidden-page') === 'true';
const { appContainer, pageContainer } = props;
const {
pageId, path, createdAt, creator, updatedAt, revisionAuthor, isHeaderSticky, isSubnavCompact,
} = pageContainer.state;
const isPageNotFound = pageId == null;
const isPageInTrash = isTrashPage(path);
const dPagePath = new DevidedPagePath(pageContainer.state.path, false, true);
const linkedPagePathFormer = new LinkedPagePath(dPagePath.former);
const renderFormerLink = () => (
<>
{ !dPagePath.isRoot &&