-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
Copy pathWorkspaceBillsPage.js
44 lines (40 loc) · 1.48 KB
/
WorkspaceBillsPage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import React from 'react';
import PropTypes from 'prop-types';
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize';
import WorkspaceBillsNoVBAView from './WorkspaceBillsNoVBAView';
import WorkspaceBillsVBAView from './WorkspaceBillsVBAView';
import WorkspacePageWithSections from '../WorkspacePageWithSections';
import CONST from '../../../CONST';
const propTypes = {
/** The route object passed to this page from the navigator */
route: PropTypes.shape({
/** Each parameter passed via the URL */
params: PropTypes.shape({
/** The policyID that is being configured */
policyID: PropTypes.string.isRequired,
}).isRequired,
}).isRequired,
...withLocalizePropTypes,
};
const WorkspaceBillsPage = props => (
<WorkspacePageWithSections
shouldUseScrollView
headerText={props.translate('workspace.common.bills')}
route={props.route}
guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_BILLS}
>
{(hasVBA, policyID) => (
<>
{!hasVBA && (
<WorkspaceBillsNoVBAView policyID={policyID} />
)}
{hasVBA && (
<WorkspaceBillsVBAView policyID={policyID} />
)}
</>
)}
</WorkspacePageWithSections>
);
WorkspaceBillsPage.propTypes = propTypes;
WorkspaceBillsPage.displayName = 'WorkspaceBillsPage';
export default withLocalize(WorkspaceBillsPage);