<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import {Switch, Route} from 'react-router';

import DataListPage from 'metadata-react/DataList';
import DataObjPage from 'metadata-react/FrmObj';
//import MetaObjPage from '../../components/MetaObjPage';
import NotFoundPage from '../NotFoundPage';

// отчет
import RepCashMoving from '../RepCashMoving';


const DataRoute = ({match}) => {

  const {area, name} = match.params;
  const _mgr = $p[area][name];
  const _acl = $p.current_user.get_acl(_mgr.class_name);

  return area === 'rep' ?
    <RepCashMoving _mgr={_mgr} _acl={_acl} match={match} />
    :
    <Switch>
      <Route path={`${match.url}/:ref([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})`} render={(props) => <DataObjPage _mgr={_mgr} _acl={_acl} {...props}/>} />
      <Route path={`${match.url}/list`} render={(props) => <DataListPage _mgr={_mgr} _acl={_acl} {...props}/>} />
      {/**<Route path={`${match.url}/meta`} render={(props) => <MetaObjPage _mgr={_mgr} {...props}/>} />**/}
      <Route component={NotFoundPage}/>
  </Switch>;
};
DataRoute.propTypes = {
  match: PropTypes.object.isRequired,
};

export default DataRoute;
<commit_msg>DataList WindowSizer<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import {Switch, Route} from 'react-router';

import WindowSizer from 'metadata-react/WindowSize';

import DataListPage from 'metadata-react/DataList';
import DataObjPage from 'metadata-react/FrmObj';
//import MetaObjPage from '../../components/MetaObjPage';
import NotFoundPage from '../NotFoundPage';

// отчет
import RepCashMoving from '../RepCashMoving';


const DataRoute = ({match, windowHeight, windowWidth}) => {

  const {area, name} = match.params;
  const _mgr = $p[area][name];
  const _acl = $p.current_user.get_acl(_mgr.class_name);

  const sizes = {
    height: windowHeight > 480 ? windowHeight - 52 : 428,
    width: windowWidth > 800 ? windowWidth - (windowHeight < 480 ? 20 : 0) : 800
  };

  return area === 'rep' ?
    <RepCashMoving _mgr={_mgr} _acl={_acl} match={match} />
    :
    <Switch>
      <Route path={`${match.url}/:ref([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})`} render={(props) => <DataObjPage _mgr={_mgr} _acl={_acl} {...props}/>} />
      <Route path={`${match.url}/list`} render={(props) => <DataListPage _mgr={_mgr} _acl={_acl} {...props} {...sizes} />} />
      {/**<Route path={`${match.url}/meta`} render={(props) => <MetaObjPage _mgr={_mgr} {...props}/>} />**/}
      <Route component={NotFoundPage}/>
  </Switch>;
};
DataRoute.propTypes = {
  match: PropTypes.object.isRequired,
};

export default WindowSizer(DataRoute);

{'fraction_non_alphanumeric': 0.21263940520446098, 'fraction_numerical': 0.019330855018587362, 'mean_word_length': 4.155172413793103, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '4492399', 'n_tokens_mistral': 993, 'n_tokens_neox': 985, 'n_words': 193}