mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
re-structure to monorepo.
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import { Alignment, Navbar, NavbarGroup } from '@blueprintjs/core';
|
||||
|
||||
import { DashboardViewsTabs } from '@/components';
|
||||
import { compose, transfromViewsToTabs } from '@/utils';
|
||||
import { useCreditNoteListContext } from './CreditNotesListProvider';
|
||||
|
||||
import withCreditNotes from './withCreditNotes';
|
||||
import withCreditNotesActions from './withCreditNotesActions';
|
||||
|
||||
/**
|
||||
* Credit Note views tabs.
|
||||
*/
|
||||
function CreditNotesViewTabs({
|
||||
// #withCreditNotes
|
||||
creditNoteCurrentView,
|
||||
|
||||
// #withCreditNotesActions
|
||||
setCreditNotesTableState,
|
||||
}) {
|
||||
// Credit note list context.
|
||||
const { CreditNotesView } = useCreditNoteListContext();
|
||||
|
||||
const tabs = transfromViewsToTabs(CreditNotesView);
|
||||
|
||||
// Handle tab change.
|
||||
const handleTabsChange = (viewSlug) => {
|
||||
setCreditNotesTableState({ viewSlug });
|
||||
};
|
||||
|
||||
return (
|
||||
<Navbar className={'navbar--dashboard-views'}>
|
||||
<NavbarGroup align={Alignment.LEFT}>
|
||||
<DashboardViewsTabs
|
||||
currentViewSlug={creditNoteCurrentView}
|
||||
resourceName={'credit_notes'}
|
||||
tabs={tabs}
|
||||
onChange={handleTabsChange}
|
||||
/>
|
||||
</NavbarGroup>
|
||||
</Navbar>
|
||||
);
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withCreditNotesActions,
|
||||
withCreditNotes(({ creditNoteTableState }) => ({
|
||||
creditNoteCurrentView: creditNoteTableState.viewSlug,
|
||||
})),
|
||||
)(CreditNotesViewTabs);
|
||||
Reference in New Issue
Block a user