re-structure to monorepo.

This commit is contained in:
a.bouhuolia
2023-02-03 01:02:31 +02:00
parent 8242ec64ba
commit 7a0a13f9d5
10400 changed files with 46966 additions and 17223 deletions

View File

@@ -0,0 +1,53 @@
// @ts-nocheck
import React from 'react';
import { Alignment, Navbar, NavbarGroup } from '@blueprintjs/core';
import { DashboardViewsTabs } from '@/components';
import { withRouter } from 'react-router-dom';
import withItems from './withItems';
import withItemsActions from './withItemsActions';
import { useItemsListContext } from './ItemsListProvider';
import { compose, transfromViewsToTabs } from '@/utils';
/**
* Items views tabs.
*/
function ItemsViewsTabs({
// #withItemsActions
setItemsTableState,
// #withItems
itemsCurrentView,
}) {
const { itemsViews } = useItemsListContext();
// Mapped items views.
const tabs = transfromViewsToTabs(itemsViews);
// Handles the active tab change.
const handleTabChange = (viewSlug) => {
setItemsTableState({ viewSlug });
};
return (
<Navbar className="navbar--dashboard-views">
<NavbarGroup align={Alignment.LEFT}>
<DashboardViewsTabs
currentViewSlug={itemsCurrentView}
resourceName={'items'}
tabs={tabs}
onChange={handleTabChange}
/>
</NavbarGroup>
</Navbar>
);
}
export default compose(
withRouter,
withItems(({ itemsTableState }) => ({
itemsCurrentView: itemsTableState?.viewSlug,
})),
withItemsActions,
)(ItemsViewsTabs);