<commit_before>import React, {Fragment} from "react";
import { observer, inject } from "mobx-react";
import { Page, Navbar, List, ListItem, BlockTitle } from "framework7-react";
import { useTranslation } from "react-i18next";

const PageDocumentInfo = (props) => {
  const { t } = useTranslation();
  const _t = t("Settings", { returnObjects: true });
  const storeInfo = props.storeDocumentInfo;
  const dataApp = props.getAppProps();
  const dataModified = props.getModified();
  const dataModifiedBy = props.getModifiedBy();
  const {
    pageCount,
    paragraphCount,
    symbolsCount,
    symbolsWSCount,
    wordsCount,
  } = storeInfo.infoObj;
  const dataDoc = JSON.parse(JSON.stringify(storeInfo.dataDoc));
  const isLoaded = storeInfo.isLoaded;

  if (!isLoaded) {
    console.log(
      pageCount,
      paragraphCount,
      symbolsCount,
      symbolsWSCount,
      wordsCount
    );
    return (
      <Page>
        <Navbar title={_t.textDocumentInfo} backLink={_t.textBack} />
        <BlockTitle>{_t.textDocumentTitle}</BlockTitle>
        <List>
          <ListItem title={dataDoc.title}></ListItem>
        </List>
        <BlockTitle>{_t.textOwner}</BlockTitle>
        <List>
          <ListItem title={dataDoc.info.author}></ListItem>
        </List>
        <BlockTitle>{_t.textUploaded}</BlockTitle>
        <List>
          <ListItem title={dataDoc.info.created}></ListItem>
        </List>
        <BlockTitle>{_t.textStatistic}</BlockTitle>
        <List>
          <ListItem title="Pages" after={pageCount}></ListItem>
          <ListItem title="Paragraphs" after={paragraphCount}></ListItem>
          <ListItem title="Words" after={wordsCount}></ListItem>
          <ListItem title="Symbols" after={symbolsCount}></ListItem>
          <ListItem title="Spaces" after={symbolsWSCount}></ListItem>
        </List>
        {dataModified && dataModifiedBy ? (
          <Fragment>
            <BlockTitle>{_t.textLastModified}</BlockTitle>
            <List>
              <ListItem title="11/19/2020 1:13 PM"></ListItem>
            </List>
            <BlockTitle>{_t.textLastModifiedBy}</BlockTitle>
            <List>
              <ListItem title="<NAME>"></ListItem>
            </List>
          </Fragment>
        ) : null}
        {dataApp ? (
          <Fragment>
            <BlockTitle>{_t.textApplication}</BlockTitle>
            <List>
              <ListItem title="ONLYOFFICE/6.0.2.5"></ListItem>
            </List>
          </Fragment>
        ) : null}
      </Page>
    );
  }
};

const DocumentInfo = inject("storeDocumentInfo")(observer(PageDocumentInfo));

export default DocumentInfo;<commit_msg>Small edit view Document Info<commit_after>import React, {Fragment} from "react";
import { observer, inject } from "mobx-react";
import { Page, Navbar, List, ListItem, BlockTitle } from "framework7-react";
import { useTranslation } from "react-i18next";

const PageDocumentInfo = (props) => {
  const { t } = useTranslation();
  const _t = t("Settings", { returnObjects: true });
  const storeInfo = props.storeDocumentInfo;
  const dataApp = props.getAppProps();
  const dataModified = props.getModified();
  const dataModifiedBy = props.getModifiedBy();
  const {
    pageCount,
    paragraphCount,
    symbolsCount,
    symbolsWSCount,
    wordsCount,
  } = storeInfo.infoObj;
  const dataDoc = JSON.parse(JSON.stringify(storeInfo.dataDoc));
  const isLoaded = storeInfo.isLoaded;

  if (!isLoaded) {
    console.log(
      pageCount,
      paragraphCount,
      symbolsCount,
      symbolsWSCount,
      wordsCount
    );
    return (
      <Page>
        <Navbar title={_t.textDocumentInfo} backLink={_t.textBack} />
        <BlockTitle>{_t.textDocumentTitle}</BlockTitle>
        <List>
          <ListItem title={dataDoc.title}></ListItem>
        </List>
        <BlockTitle>{_t.textOwner}</BlockTitle>
        <List>
          <ListItem title={dataDoc.info.author}></ListItem>
        </List>
        <BlockTitle>{_t.textUploaded}</BlockTitle>
        <List>
          <ListItem title={dataDoc.info.created}></ListItem>
        </List>
        <BlockTitle>{_t.textStatistic}</BlockTitle>
        <List>
          <ListItem title="Pages" after={pageCount}></ListItem>
          <ListItem title="Paragraphs" after={paragraphCount}></ListItem>
          <ListItem title="Words" after={wordsCount}></ListItem>
          <ListItem title="Symbols" after={symbolsCount}></ListItem>
          <ListItem title="Spaces" after={symbolsWSCount}></ListItem>
        </List>
        {dataModified && dataModifiedBy ? (
          <Fragment>
            <BlockTitle>{_t.textLastModified}</BlockTitle>
            <List>
              <ListItem title={dataModified}></ListItem>
            </List>
            <BlockTitle>{_t.textLastModifiedBy}</BlockTitle>
            <List>
              <ListItem title={dataModifiedBy}></ListItem>
            </List>
          </Fragment>
        ) : null}
        {dataApp ? (
          <Fragment>
            <BlockTitle>{_t.textApplication}</BlockTitle>
            <List>
              <ListItem title={dataApp}></ListItem>
            </List>
          </Fragment>
        ) : null}
      </Page>
    );
  }
};

const DocumentInfo = inject("storeDocumentInfo")(observer(PageDocumentInfo));

export default DocumentInfo;
{'fraction_non_alphanumeric': 0.13817153628652215, 'fraction_numerical': 0.003958529688972668, 'mean_word_length': 2.5396931287525017, 'pattern_counts': {'":': 0, '<': 118, '<?xml version=': 0, '>': 120, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7390182', 'n_tokens_mistral': 1561, 'n_tokens_neox': 1558, 'n_words': 275}