mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
chrone: sperate client and server to different repos.
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
import React, { useMemo, useCallback } from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
import FinancialSheet from 'components/FinancialSheet';
|
||||
import { DataTable } from 'components';
|
||||
import { useInventoryItemDetailsColumns } from './components';
|
||||
import { useInventoryItemDetailsContext } from './InventoryItemDetailsProvider';
|
||||
|
||||
import { defaultExpanderReducer } from 'utils';
|
||||
|
||||
/**
|
||||
* Inventory item detail table.
|
||||
*/
|
||||
export default function InventoryItemDetailsTable({
|
||||
// #ownProps
|
||||
companyName,
|
||||
}) {
|
||||
const {
|
||||
inventoryItemDetails: { tableRows },
|
||||
isInventoryItemDetailsLoading,
|
||||
query,
|
||||
} = useInventoryItemDetailsContext();
|
||||
|
||||
const columns = useInventoryItemDetailsColumns();
|
||||
|
||||
const expandedRows = useMemo(
|
||||
() => defaultExpanderReducer(tableRows, 4),
|
||||
[tableRows],
|
||||
);
|
||||
|
||||
const rowClassNames = (row) => {
|
||||
return [`row-type--${row.original.rowTypes}`];
|
||||
};
|
||||
|
||||
return (
|
||||
<FinancialSheet
|
||||
name="inventory-item-details"
|
||||
companyName={companyName}
|
||||
sheetType={intl.get('inventory_item_details')}
|
||||
loading={isInventoryItemDetailsLoading}
|
||||
fromDate={query.from_date}
|
||||
toDate={query.to_date}
|
||||
>
|
||||
<DataTable
|
||||
className="bigcapital-datatable--financial-report"
|
||||
columns={columns}
|
||||
data={tableRows}
|
||||
rowClassNames={rowClassNames}
|
||||
noInitialFetch={true}
|
||||
expandable={true}
|
||||
expanded={expandedRows}
|
||||
expandToggleColumn={1}
|
||||
expandColumnSpace={0.8}
|
||||
/>
|
||||
</FinancialSheet>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user