mirror of
https://github.com/bakhirev/assayo.git
synced 2025-04-22 17:49:12 +00:00
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import React from 'react';
|
|
import { observer } from 'mobx-react-lite';
|
|
|
|
import ISort from 'ts/interfaces/Sort';
|
|
import { IPaginationRequest } from 'ts/interfaces/Pagination';
|
|
import dataGripStore from 'ts/store/DataGrip';
|
|
|
|
import ICommonPageProps from 'ts/components/Page/interfaces/CommonPageProps';
|
|
import DataLoader from 'ts/components/DataLoader';
|
|
import Pagination from 'ts/components/DataLoader/components/Pagination';
|
|
import getFakeLoader from 'ts/components/DataLoader/helpers/formatter';
|
|
import NothingFound from 'ts/components/NothingFound';
|
|
import Title from 'ts/components/Title';
|
|
import Companies from './Companies';
|
|
|
|
const Company = observer(({
|
|
mode,
|
|
}: ICommonPageProps): React.ReactElement | null => {
|
|
const rows = dataGripStore.dataGrip.company.statistic;
|
|
|
|
if (!rows?.length) {
|
|
return mode !== 'print' ? (<NothingFound />) : null;
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<Title title="page.team.author.title"/>
|
|
<DataLoader
|
|
to="response"
|
|
loader={(pagination?: IPaginationRequest, sort?: ISort[]) => getFakeLoader({
|
|
content: rows, pagination, sort, mode,
|
|
})}
|
|
watch={`${mode}${dataGripStore.hash}`}
|
|
>
|
|
<Companies
|
|
mode={mode}
|
|
rowsForExcel={rows}
|
|
/>
|
|
<Pagination />
|
|
</DataLoader>
|
|
</>
|
|
);
|
|
});
|
|
|
|
export default Company;
|