mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 12:20:31 +00:00
47 lines
1.4 KiB
JavaScript
47 lines
1.4 KiB
JavaScript
import React from 'react';
|
|
import classNames from 'classnames';
|
|
import { FormGroup, Classes } from '@blueprintjs/core';
|
|
import { Field } from 'formik';
|
|
import { Row, Col, FormattedMessage as T } from 'components';
|
|
import { ItemsMultiSelect } from 'components';
|
|
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
|
import { useInventoryItemDetailsContext } from './InventoryItemDetailsProvider';
|
|
|
|
/**
|
|
* Inventory item details header - General panel.
|
|
*/
|
|
export default function InventoryItemDetailsHeaderGeneralPanel() {
|
|
const { items } = useInventoryItemDetailsContext();
|
|
|
|
return (
|
|
<div>
|
|
<FinancialStatementDateRange />
|
|
|
|
<Row>
|
|
<Col xs={4}>
|
|
<Field name={'itemsIds'}>
|
|
{({
|
|
form: { setFieldValue },
|
|
field: { value },
|
|
meta: { error, touched },
|
|
}) => (
|
|
<FormGroup
|
|
label={<T id={'Specific items'} />}
|
|
className={classNames('form-group--select-list', Classes.FILL)}
|
|
>
|
|
<ItemsMultiSelect
|
|
items={items}
|
|
selectedItems={value}
|
|
onItemSelect={(itemsIds) => {
|
|
setFieldValue('itemsIds', itemsIds);
|
|
}}
|
|
/>
|
|
</FormGroup>
|
|
)}
|
|
</Field>
|
|
</Col>
|
|
</Row>
|
|
</div>
|
|
);
|
|
}
|